Class: Rack::Mongoid::Middleware::IdentityMap
- Defined in:
- lib/rack/mongoid/middleware/identity_map.rb
Overview
This middleware contains the behaviour needed to properly use the identity map in Rack based applications.
Instance Method Summary collapse
-
#call(env) ⇒ Array
Make the request with the provided environment.
-
#initialize(app) ⇒ IdentityMap
constructor
Initialize the new middleware.
Constructor Details
#initialize(app) ⇒ IdentityMap
Initialize the new middleware.
IdentityMap.new(app)
18 19 20 |
# File 'lib/rack/mongoid/middleware/identity_map.rb', line 18 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Array
Make the request with the provided environment.
identity_map.call(env)
32 33 34 |
# File 'lib/rack/mongoid/middleware/identity_map.rb', line 32 def call(env) ::Mongoid.unit_of_work { @app.call(env) } end |