Class: Wikidata::Property::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/wikidata/property/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(property) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/wikidata/property/base.rb', line 7

def initialize property
  @property = Hashie::Mash.new(property)
end

Instance Attribute Details

#propertyObject (readonly)

Returns the value of attribute property.



5
6
7
# File 'lib/wikidata/property/base.rb', line 5

def property
  @property
end

Instance Method Details

#valueObject



11
12
13
# File 'lib/wikidata/property/base.rb', line 11

def value
  property.mainsnak.datavalue.value
end