Class: Faraday::Middleware

Inherits:
Object show all
Defined in:
lib/faraday/middleware.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app = nil) ⇒ Middleware



25
26
27
# File 'lib/faraday/middleware.rb', line 25

def initialize(app = nil)
  @app = app
end

Class Attribute Details

.load_errorObject

Returns the value of attribute load_error



4
5
6
# File 'lib/faraday/middleware.rb', line 4

def load_error
  @load_error
end

.supports_parallel_requestsObject Also known as: supports_parallel_requests?

Returns the value of attribute supports_parallel_requests



4
5
6
# File 'lib/faraday/middleware.rb', line 4

def supports_parallel_requests
  @supports_parallel_requests
end

Class Method Details

.dependency(lib = nil) ⇒ Object

Executes a block which should try to require and reference dependent libraries



15
16
17
18
19
# File 'lib/faraday/middleware.rb', line 15

def self.dependency(lib = nil)
  lib ? require(lib) : yield
rescue LoadError, NameError => error
  self.load_error = error
end

.loaded?Boolean



21
22
23
# File 'lib/faraday/middleware.rb', line 21

def self.loaded?
  @load_error.nil?
end

.setup_parallel_manager(options = {}) ⇒ Object

valid parallel managers should respond to #run with no parameters. otherwise, return a short wrapper around it.



9
10
11
# File 'lib/faraday/middleware.rb', line 9

def setup_parallel_manager(options = {})
  nil
end