Class: Faraday::Middleware

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

Direct Known Subclasses

Adapter, Request::UrlEncoded, Response::Middleware

Class Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Middleware) initialize(app = nil)



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

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

Class Attribute Details

+ (Object) load_error

Returns the value of attribute load_error



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

def load_error
  @load_error
end

+ (Object) supports_parallel_requests 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

+ (Object) dependency(lib = nil)

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

+ (Boolean) loaded?



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

def self.loaded?
  @load_error.nil?
end

+ (Object) setup_parallel_manager(options = {})

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