Class: ROM::Session::Mapper Private
- Inherits:
-
Mapper
- Object
- Mapper
- ROM::Session::Mapper
- Includes:
- Proxy
- Defined in:
- lib/rom/session/mapper.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .build(mapper, tracker) ⇒ Object private
Instance Method Summary collapse
- #dirty?(object) ⇒ Boolean private
- #load(tuple) ⇒ Object private
- #store_in_identity_map(object) ⇒ Object private
Methods included from Proxy
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ROM::Proxy
Class Method Details
.build(mapper, tracker) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/rom/session/mapper.rb', line 11 def self.build(mapper, tracker) new(mapper, tracker, IdentityMap.build) end |
Instance Method Details
#dirty?(object) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 |
# File 'lib/rom/session/mapper.rb', line 16 def dirty?(object) identity_map.fetch_tuple(identity(object)) != dump(object) end |
#load(tuple) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 24 |
# File 'lib/rom/session/mapper.rb', line 21 def load(tuple) identity = mapper.identity_from_tuple(tuple) identity_map.fetch_object(identity) { load_and_track(identity, tuple) } end |
#store_in_identity_map(object) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 |
# File 'lib/rom/session/mapper.rb', line 27 def store_in_identity_map(object) identity_map.store(identity(object), object, dump(object)) end |