Class: WikidataPositionHistory::MandateRow
Overview
Represents a single row returned from the Mandates query
Instance Method Summary
collapse
#initialize
Instance Method Details
#acting? ⇒ Boolean
86
87
88
|
# File 'lib/sparql/mandates_query.rb', line 86
def acting?
nature == 'Q4676846'
end
|
#end_date ⇒ Object
94
95
96
|
# File 'lib/sparql/mandates_query.rb', line 94
def end_date
date_from(:end_date, :end_precision)
end
|
#nature ⇒ Object
TODO: switch to item_from
82
83
84
|
# File 'lib/sparql/mandates_query.rb', line 82
def nature
QueryService::WikidataItem.new(row.dig(:nature, :value)).id
end
|
#next ⇒ Object
TODO: switch to item_from
77
78
79
|
# File 'lib/sparql/mandates_query.rb', line 77
def next
QueryService::WikidataItem.new(row.dig(:next, :value)).qlink
end
|
#officeholder ⇒ Object
63
64
65
|
# File 'lib/sparql/mandates_query.rb', line 63
def officeholder
item_from(:item)
end
|
#ordinal ⇒ Object
59
60
61
|
# File 'lib/sparql/mandates_query.rb', line 59
def ordinal
raw(:ordinal)
end
|
#party ⇒ Object
67
68
69
|
# File 'lib/sparql/mandates_query.rb', line 67
def party
item_from(:party)
end
|
#prev ⇒ Object
TODO: switch to item_from
72
73
74
|
# File 'lib/sparql/mandates_query.rb', line 72
def prev
QueryService::WikidataItem.new(row.dig(:prev, :value)).qlink
end
|
#start_date ⇒ Object
90
91
92
|
# File 'lib/sparql/mandates_query.rb', line 90
def start_date
date_from(:start_date, :start_precision)
end
|