Class: WikibaseRepresentable::Model::EntityIdValue
- Defined in:
- lib/wikibase_representable/model/entity_id_value.rb
Overview
Data value representing an entity ID data value
Constant Summary collapse
- TYPE =
'wikibase-entityid'
Instance Attribute Summary
Attributes inherited from DataValue
Instance Method Summary collapse
- #==(other) ⇒ Object
- #entity_type ⇒ Object
- #eql?(other) ⇒ Boolean
- #id ⇒ Object
-
#initialize(value: nil) ⇒ EntityIdValue
constructor
A new instance of EntityIdValue.
- #numeric_id ⇒ Object
- #state ⇒ Object
Constructor Details
#initialize(value: nil) ⇒ EntityIdValue
Returns a new instance of EntityIdValue.
11 12 13 |
# File 'lib/wikibase_representable/model/entity_id_value.rb', line 11 def initialize(value: nil) super(type: TYPE, value: value) end |
Instance Method Details
#==(other) ⇒ Object
31 32 33 |
# File 'lib/wikibase_representable/model/entity_id_value.rb', line 31 def ==(other) other.class == self.class && other.state == state end |
#entity_type ⇒ Object
19 20 21 |
# File 'lib/wikibase_representable/model/entity_id_value.rb', line 19 def entity_type value.entity_type end |
#eql?(other) ⇒ Boolean
35 36 37 |
# File 'lib/wikibase_representable/model/entity_id_value.rb', line 35 def eql?(other) self == other end |
#id ⇒ Object
15 16 17 |
# File 'lib/wikibase_representable/model/entity_id_value.rb', line 15 def id value.id end |
#numeric_id ⇒ Object
23 24 25 |
# File 'lib/wikibase_representable/model/entity_id_value.rb', line 23 def numeric_id value.numeric_id end |
#state ⇒ Object
27 28 29 |
# File 'lib/wikibase_representable/model/entity_id_value.rb', line 27 def state [type, value] end |