Class: Guacamole::IdentityMap::Session
- Inherits:
-
Object
- Object
- Guacamole::IdentityMap::Session
- Defined in:
- lib/guacamole/identity_map.rb
Overview
The IdentityMap::Session
acts as Rack middleware to reset the Guacamole::IdentityMap
before each request.
Instance Method Summary collapse
-
#call(env) ⇒ Array
Run the concrete middleware.
-
#initialize(app) ⇒ Session
constructor
Create a new instance of the
Session
middleware.
Constructor Details
#initialize(app) ⇒ Session
Create a new instance of the Session
middleware
You must pass an object that responds to call
in the constructor. This
will be the called after the IdentityMap
has been purged.
28 29 30 |
# File 'lib/guacamole/identity_map.rb', line 28 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Array
Run the concrete middleware
This satisfies the Rack interface and will be called to reset the IdentityMap
before each request. In the end the @app
will be called.
39 40 41 42 43 44 |
# File 'lib/guacamole/identity_map.rb', line 39 def call(env) Guacamole.logger.debug '[SESSION] Resetting the IdentityMap' IdentityMap.reset @app.call(env) end |