Class: Spid::Rack::Session
- Inherits:
-
Object
- Object
- Spid::Rack::Session
- Defined in:
- lib/spid/rack/session.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Session
constructor
A new instance of Session.
Constructor Details
#initialize(app) ⇒ Session
Returns a new instance of Session.
8 9 10 |
# File 'lib/spid/rack/session.rb', line 8 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
6 7 8 |
# File 'lib/spid/rack/session.rb', line 6 def app @app end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 |
# File 'lib/spid/rack/session.rb', line 12 def call(env) request = ::Rack::Request.new(env) request.session["spid"] ||= {} app.call(env) end |