Class: MassiveRecord::ORM::IdentityMap::Middleware::BodyProxy
- Inherits:
-
Object
- Object
- MassiveRecord::ORM::IdentityMap::Middleware::BodyProxy
- Defined in:
- lib/massive_record/orm/identity_map.rb
Instance Method Summary collapse
- #close ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(target, original_identity_map_state) ⇒ BodyProxy
constructor
A new instance of BodyProxy.
Constructor Details
#initialize(target, original_identity_map_state) ⇒ BodyProxy
Returns a new instance of BodyProxy.
222 223 224 225 |
# File 'lib/massive_record/orm/identity_map.rb', line 222 def initialize(target, original_identity_map_state) @target = target @original_identity_map_state = original_identity_map_state end |
Instance Method Details
#close ⇒ Object
231 232 233 234 235 236 |
# File 'lib/massive_record/orm/identity_map.rb', line 231 def close @target.close if @target.respond_to?(:close) ensure IdentityMap.enabled = @original_identity_map_state IdentityMap.clear end |
#each(&block) ⇒ Object
227 228 229 |
# File 'lib/massive_record/orm/identity_map.rb', line 227 def each(&block) @target.each(&block) end |