Class: Alf::Rest::Middleware
- Inherits:
-
Object
- Object
- Alf::Rest::Middleware
- Defined in:
- lib/alf/rest/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, config) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, config) ⇒ Middleware
Returns a new instance of Middleware.
5 6 7 8 |
# File 'lib/alf/rest/middleware.rb', line 5 def initialize(app, config) @app = app @config = config end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/alf/rest/middleware.rb', line 10 def call(env) env[Rest::RACK_CONFIG_KEY] = cfg = @config.dup cfg.connect do @app.call(env) end end |