Class: MongoMapper::Middleware::IdentityMap::Body
- Extended by:
- Forwardable
- Defined in:
- lib/mongo_mapper/middleware/identity_map.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(target, original) ⇒ Body
constructor
A new instance of Body.
Constructor Details
#initialize(target, original) ⇒ Body
Returns a new instance of Body.
15 16 17 18 |
# File 'lib/mongo_mapper/middleware/identity_map.rb', line 15 def initialize(target, original) @target = target @original = original end |
Instance Method Details
#close ⇒ Object
20 21 22 23 24 25 |
# File 'lib/mongo_mapper/middleware/identity_map.rb', line 20 def close @target.close if @target.respond_to?(:close) ensure MongoMapper::Plugins::IdentityMap.enabled = @original MongoMapper::Plugins::IdentityMap.clear end |