Class: TinyRackFlash::Middleware
- Inherits:
-
Object
- Object
- TinyRackFlash::Middleware
- Defined in:
- lib/tiny_rack_flash.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, opts = {}) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, opts = {}) ⇒ Middleware
Returns a new instance of Middleware.
57 58 59 |
# File 'lib/tiny_rack_flash.rb', line 57 def initialize(app, opts={}) @app, @opts = app, opts end |
Instance Method Details
#call(env) ⇒ Object
61 62 63 64 65 |
# File 'lib/tiny_rack_flash.rb', line 61 def call(env) res = @app.call(env) env[SessionKey][FlashKey] = env[FlashKey].next if env[FlashKey] res end |