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.



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

def initialize(property)
  @property = Wikidata::Property::Hash.new(property)
end

Instance Attribute Details

#propertyObject (readonly)

Returns the value of attribute property.



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

def property
  @property
end

Instance Method Details

#valueObject



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

def value
  property.mainsnak.datavalue.value
end