Class: EntityMap::Entity
- Inherits:
-
Object
- Object
- EntityMap::Entity
- Defined in:
- lib/entity_map/entity/new.rb,
lib/entity_map/entity/methods.rb,
lib/entity_map/entity/class_methods.rb
Instance Attribute Summary collapse
-
#entity_group ⇒ Object
readonly
Returns the value of attribute entity_group.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#initialize(object, entity_group) ⇒ Entity
constructor
A new instance of Entity.
Constructor Details
#initialize(object, entity_group) ⇒ Entity
Returns a new instance of Entity.
6 7 8 9 10 11 |
# File 'lib/entity_map/entity/new.rb', line 6 def initialize(object, entity_group) raise "INTERNAL ERROR: Entity.new must have EntityGroup argument" unless EntityGroup === entity_group @entity_group = entity_group @object = object insert_into_entity_hash end |
Instance Attribute Details
#entity_group ⇒ Object (readonly)
Returns the value of attribute entity_group.
4 5 6 |
# File 'lib/entity_map/entity/new.rb', line 4 def entity_group @entity_group end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
4 5 6 |
# File 'lib/entity_map/entity/new.rb', line 4 def object @object end |
Class Method Details
.object_ref(o) ⇒ Object
5 6 7 |
# File 'lib/entity_map/entity/class_methods.rb', line 5 def object_ref(o) o.object_id end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
4 5 6 |
# File 'lib/entity_map/entity/methods.rb', line 4 def ==(other) Entity.object_ref(self) == Entity.object_ref(other) end |