Class: ROM::Session::IdentityMap Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rom/session/identity_map.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.

Defined Under Namespace

Classes: LoadedObject

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(objects = {}) ⇒ 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.



15
16
17
# File 'lib/rom/session/identity_map.rb', line 15

def self.build(objects = {})
  new(objects)
end

Instance Method Details

#[](identity) ⇒ 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.



20
21
22
# File 'lib/rom/session/identity_map.rb', line 20

def [](identity)
  objects[identity]
end

#fetch_object(identity, &block) ⇒ 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.



25
26
27
# File 'lib/rom/session/identity_map.rb', line 25

def fetch_object(identity, &block)
  objects.fetch(identity, &block).object
end

#fetch_tuple(identity) ⇒ 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.



30
31
32
# File 'lib/rom/session/identity_map.rb', line 30

def fetch_tuple(identity)
  self[identity].tuple
end

#store(identity, object, 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.



35
36
37
38
# File 'lib/rom/session/identity_map.rb', line 35

def store(identity, object, tuple)
  objects[identity] = LoadedObject.new(object, tuple)
  self
end