Class: Wikidatum::Term
- Inherits:
-
Object
- Object
- Wikidatum::Term
- Defined in:
- lib/wikidatum/term.rb
Overview
Wikidatum::Term represents “Terms”, which are pairs of language codes and values. They’re used for things like item labels, descriptions, and aliases.
Instance Attribute Summary collapse
-
#lang ⇒ String
readonly
A language code (‘en’, ‘zh-mo’, etc).
-
#value ⇒ String
readonly
The value of the Term.
Instance Method Summary collapse
Instance Attribute Details
#lang ⇒ String (readonly)
Returns A language code (‘en’, ‘zh-mo’, etc).
7 8 9 |
# File 'lib/wikidatum/term.rb', line 7 def lang @lang end |
#value ⇒ String (readonly)
Returns The value of the Term.
10 11 12 |
# File 'lib/wikidatum/term.rb', line 10 def value @value end |
Instance Method Details
#inspect ⇒ String
31 32 33 |
# File 'lib/wikidatum/term.rb', line 31 def inspect "<Wikidatum::Term lang=#{@lang.inspect} value=#{@value.inspect}>" end |
#to_h ⇒ Hash
23 24 25 26 27 28 |
# File 'lib/wikidatum/term.rb', line 23 def to_h { lang: @lang, value: @value } end |