Class: Wikimelon::Reference
- Inherits:
-
Object
- Object
- Wikimelon::Reference
- Defined in:
- lib/wikimelon/reference.rb
Overview
A citation attached to a Statement. Holds a bag of snaks keyed by property, commonly P248 (“stated in”), P854 (“reference URL”), P813 (“retrieved”), P1476 (“title”), P143 (“imported from”).
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(raw) ⇒ Reference
constructor
A new instance of Reference.
- #properties ⇒ Object
- #snaks(property_id) ⇒ Object
Constructor Details
#initialize(raw) ⇒ Reference
Returns a new instance of Reference.
10 11 12 |
# File 'lib/wikimelon/reference.rb', line 10 def initialize(raw) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
8 9 10 |
# File 'lib/wikimelon/reference.rb', line 8 def raw @raw end |
Instance Method Details
#properties ⇒ Object
18 19 20 |
# File 'lib/wikimelon/reference.rb', line 18 def properties @raw['snaks-order'] || (@raw['snaks'] || {}).keys end |