Class: TinyRackFlash::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/tiny_rack_flash.rb

Instance Method Summary collapse

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