Class: Croudia::Identity
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#id_str ⇒ Object
readonly
Returns the value of attribute id_str.
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#initialize ⇒ Identity
constructor
A new instance of Identity.
Methods inherited from Base
#[], attr_object_reader, attr_reader, #attrs, #inspect
Constructor Details
#initialize ⇒ Identity
Returns a new instance of Identity.
10 11 12 13 14 |
# File 'lib/croudia/identity.rb', line 10 def initialize(*) super raise ArgumentError, 'argument must have an "id" key' unless id @attrs['id_str'] ||= id.to_s end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/croudia/identity.rb', line 5 def id @id end |
#id_str ⇒ Object (readonly)
Returns the value of attribute id_str.
5 6 7 |
# File 'lib/croudia/identity.rb', line 5 def id_str @id_str end |
Instance Method Details
#==(other) ⇒ Boolean
18 19 20 |
# File 'lib/croudia/identity.rb', line 18 def ==(other) super || self.class == other.class && id == other.id end |