Class: Rack::Mongoid::Middleware::IdentityMap
- Inherits:
-
Object
- Object
- 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. This middleware will properly handle Rails or Rack streaming responses.
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.
19 20 21 |
# File 'lib/rack/mongoid/middleware/identity_map.rb', line 19 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Array
Make the request with the provided environment.
33 34 35 |
# File 'lib/rack/mongoid/middleware/identity_map.rb', line 33 def call(env) ::Mongoid.unit_of_work { @app.call(env) } end |