Class: HttpMonkey::Middlewares::Cookie
- Inherits:
-
Object
- Object
- HttpMonkey::Middlewares::Cookie
- Defined in:
- lib/http_monkey/middlewares/cookie.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Cookie
constructor
A new instance of Cookie.
Constructor Details
#initialize(app, options = {}) ⇒ Cookie
Returns a new instance of Cookie.
5 6 7 8 9 |
# File 'lib/http_monkey/middlewares/cookie.rb', line 5 def initialize(app, = {}) @app = app @store = .fetch(:store, HttpMonkey::Cookie::MemoryStore.instance) @debug = .fetch(:debug, false) end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/http_monkey/middlewares/cookie.rb', line 11 def call(env) log "-> Cookie Middleware" (env) response = @app.call(env) (env, response) log "<- Cookie Middleware" response end |