Class: WikibaseRepresentable::Model::EntityId
- Inherits:
-
Object
- Object
- WikibaseRepresentable::Model::EntityId
- Defined in:
- lib/wikibase_representable/model/entity_id.rb
Overview
Data value representing an entity ID data value
Instance Attribute Summary collapse
-
#entity_type ⇒ Object
Returns the value of attribute entity_type.
-
#id ⇒ Object
Returns the value of attribute id.
-
#numeric_id ⇒ Object
Returns the value of attribute numeric_id.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(id: nil, numeric_id: nil, entity_type: nil) ⇒ EntityId
constructor
A new instance of EntityId.
- #state ⇒ Object
Constructor Details
#initialize(id: nil, numeric_id: nil, entity_type: nil) ⇒ EntityId
Returns a new instance of EntityId.
9 10 11 12 13 |
# File 'lib/wikibase_representable/model/entity_id.rb', line 9 def initialize(id: nil, numeric_id: nil, entity_type: nil) @id = id @numeric_id = numeric_id @entity_type = entity_type end |
Instance Attribute Details
#entity_type ⇒ Object
Returns the value of attribute entity_type.
7 8 9 |
# File 'lib/wikibase_representable/model/entity_id.rb', line 7 def entity_type @entity_type end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/wikibase_representable/model/entity_id.rb', line 7 def id @id end |
#numeric_id ⇒ Object
Returns the value of attribute numeric_id.
7 8 9 |
# File 'lib/wikibase_representable/model/entity_id.rb', line 7 def numeric_id @numeric_id end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/wikibase_representable/model/entity_id.rb', line 19 def ==(other) other.class == self.class && other.state == state end |
#eql?(other) ⇒ Boolean
23 24 25 |
# File 'lib/wikibase_representable/model/entity_id.rb', line 23 def eql?(other) self == other end |
#state ⇒ Object
15 16 17 |
# File 'lib/wikibase_representable/model/entity_id.rb', line 15 def state [id, numeric_id, entity_type] end |