Class: Faraday::Middleware

Inherits:
Object
  • Object
show all
Extended by:
DependencyLoader, MiddlewareRegistry
Defined in:
lib/faraday/middleware.rb

Overview

Middleware is the basic base class of any Faraday middleware.

Instance Attribute Summary

Attributes included from DependencyLoader

#load_error

Instance Method Summary collapse

Methods included from DependencyLoader

dependency, inherited, loaded?

Methods included from MiddlewareRegistry

fetch_middleware, load_middleware, lookup_middleware, middleware_mutex, register_middleware, unregister_middleware

Constructor Details

#initialize(app = nil) ⇒ Middleware

Returns a new instance of Middleware.


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

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

Instance Method Details

#closeObject


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

def close
  if @app.respond_to?(:close)
    @app.close
  else
    warn "#{@app} does not implement \#close!"
  end
end