Class: Wikidatum::ReferencePart
- Inherits:
-
Object
- Object
- Wikidatum::ReferencePart
- Defined in:
- lib/wikidatum/reference_part.rb
Instance Attribute Summary collapse
- #data_type ⇒ String readonly
-
#property_id ⇒ String
readonly
ID of the property used, in the format “P123”.
-
#value ⇒ Wikidatum::DataType::Base
readonly
For more information on the possible types that can be returned by datavalues, see the official documentation: doc.wikimedia.org/Wikibase/master/php/docs_topics_json.html#json_datavalues.
Instance Method Summary collapse
Instance Attribute Details
#data_type ⇒ String (readonly)
8 9 10 |
# File 'lib/wikidatum/reference_part.rb', line 8 def data_type @data_type end |
#property_id ⇒ String (readonly)
Returns ID of the property used, in the format “P123”.
5 6 7 |
# File 'lib/wikidatum/reference_part.rb', line 5 def property_id @property_id end |
#value ⇒ Wikidatum::DataType::Base (readonly)
For more information on the possible types that can be returned by datavalues, see the official documentation: doc.wikimedia.org/Wikibase/master/php/docs_topics_json.html#json_datavalues
15 16 17 |
# File 'lib/wikidatum/reference_part.rb', line 15 def value @value end |
Instance Method Details
#inspect ⇒ String
37 38 39 |
# File 'lib/wikidatum/reference_part.rb', line 37 def inspect "<Wikidatum::ReferencePart property_id=#{@property_id.inspect} data_type=#{@data_type.inspect} value=#{@value.inspect}>" end |
#to_h ⇒ Hash
28 29 30 31 32 33 34 |
# File 'lib/wikidatum/reference_part.rb', line 28 def to_h { property_id: @property_id, data_type: @data_type, value: @value.to_h } end |