Class: MassiveRecord::ORM::IdentityMap::Middleware::BodyProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/massive_record/orm/identity_map.rb

Instance Method Summary collapse

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

#closeObject



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