Class: WikibaseRepresentable::Model::Term
- Inherits:
-
Object
- Object
- WikibaseRepresentable::Model::Term
- Defined in:
- lib/wikibase_representable/model/term.rb
Overview
Represents a string value specific to a langugage code.
Instance Attribute Summary collapse
-
#language_code ⇒ Object
Returns the value of attribute language_code.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(language_code: nil, value: nil) ⇒ Term
constructor
A new instance of Term.
- #state ⇒ Object
Constructor Details
#initialize(language_code: nil, value: nil) ⇒ Term
Returns a new instance of Term.
9 10 11 12 |
# File 'lib/wikibase_representable/model/term.rb', line 9 def initialize(language_code: nil, value: nil) @language_code = language_code @value = value end |
Instance Attribute Details
#language_code ⇒ Object
Returns the value of attribute language_code.
7 8 9 |
# File 'lib/wikibase_representable/model/term.rb', line 7 def language_code @language_code end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/wikibase_representable/model/term.rb', line 7 def value @value end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'lib/wikibase_representable/model/term.rb', line 18 def ==(other) other.class == self.class && other.state == state end |
#eql?(other) ⇒ Boolean
22 23 24 |
# File 'lib/wikibase_representable/model/term.rb', line 22 def eql?(other) self == other end |
#state ⇒ Object
14 15 16 |
# File 'lib/wikibase_representable/model/term.rb', line 14 def state [language_code, value] end |