Class: Makara::Middleware
- Inherits:
-
Object
- Object
- Makara::Middleware
- Defined in:
- lib/makara/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, cookie_options = {}) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, cookie_options = {}) ⇒ Middleware
Returns a new instance of Middleware.
6 7 8 9 |
# File 'lib/makara/middleware.rb', line 6 def initialize(app, = {}) @app = app @cookie_options = end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/makara/middleware.rb', line 11 def call(env) return @app.call(env) if ignore_request?(env) set_current_context(env) status, headers, body = @app.call(env) store_new_context(headers) [status, headers, body] end |