Class: MongoMapper::Middleware::IdentityMap
- Defined in:
- lib/mongo_mapper/middleware/identity_map.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ IdentityMap
constructor
A new instance of IdentityMap.
Constructor Details
#initialize(app) ⇒ IdentityMap
Returns a new instance of IdentityMap.
4 5 6 |
# File 'lib/mongo_mapper/middleware/identity_map.rb', line 4 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/mongo_mapper/middleware/identity_map.rb', line 8 def call(env) MongoMapper::Plugins::IdentityMap.clear @app.call(env) ensure MongoMapper::Plugins::IdentityMap.clear end |