Module: JetSet::Identity
- Defined in:
- lib/jet_set/mixin/identity.rb
Overview
Identity decorator. Adds identifier to pure Ruby objects.
Instance Method Summary collapse
-
#==(object) ⇒ Object
Compares the object with another object using their types and IDs.
-
#id ⇒ Object
Object identifier.
Instance Method Details
#==(object) ⇒ Object
Compares the object with another object using their types and IDs.
5 6 7 |
# File 'lib/jet_set/mixin/identity.rb', line 5 def ==(object) self.class == object.class && @id == object.id end |
#id ⇒ Object
Object identifier
10 11 12 |
# File 'lib/jet_set/mixin/identity.rb', line 10 def id @id end |