Class: Rack::Store
- Inherits:
-
Object
- Object
- Rack::Store
- Defined in:
- lib/rack/store.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Store
constructor
A new instance of Store.
Constructor Details
#initialize(app) ⇒ Store
Returns a new instance of Store.
3 4 5 |
# File 'lib/rack/store.rb', line 3 def initialize(app) @app = app end |
Class Method Details
.env ⇒ Object
13 14 15 16 |
# File 'lib/rack/store.rb', line 13 def env @env ||= {} @env[Thread.current.object_id] ||= {} end |
.env=(env) ⇒ Object
18 19 20 21 |
# File 'lib/rack/store.rb', line 18 def env=(env) @env ||= {} @env[Thread.current.object_id] = env end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 |
# File 'lib/rack/store.rb', line 7 def call(env) self.class.env = env @app.call(env) end |