Class: Restforce::Middleware

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/restforce/middleware.rb

Overview

Base class that all middleware can extend. Provides some convenient helper functions.

Defined Under Namespace

Classes: Authentication, Authorization, Caching, CustomHeaders, Gzip, InstanceURL, Logger, Mashify, Multipart, RaiseError

Instance Method Summary collapse

Constructor Details

#initialize(app, client, options) ⇒ Middleware

Returns a new instance of Middleware.



16
17
18
19
20
# File 'lib/restforce/middleware.rb', line 16

def initialize(app, client, options)
  @app = app
  @client = client
  @options = options
end

Instance Method Details

#clientObject

Internal: Proxy to the client.



23
24
25
# File 'lib/restforce/middleware.rb', line 23

def client
  @client
end

#connectionObject

Internal: Proxy to the client’s faraday connection.



28
29
30
# File 'lib/restforce/middleware.rb', line 28

def connection
  client.send(:connection)
end