class WikidataPositionHistory::OutputRow::Mandate

Date for a single mandate row, to be passed to the report template

Constants

CHECKS

Attributes

current[R]
earlier[R]
later[R]

Public Class Methods

new(later, current, earlier) click to toggle source
# File lib/wikidata_position_history/output_row.rb, line 14
def initialize(later, current, earlier)
  @later = later
  @current = current
  @earlier = earlier
end

Public Instance Methods

acting?() click to toggle source
# File lib/wikidata_position_history/output_row.rb, line 40
def acting?
  current.acting?
end
dates() click to toggle source
# File lib/wikidata_position_history/output_row.rb, line 33
def dates
  dates = [current.start_date, current.end_date]
  return '' if dates.compact.empty?

  dates.join(' – ')
end
officeholder() click to toggle source
# File lib/wikidata_position_history/output_row.rb, line 29
def officeholder
  current.officeholder
end
ordinal_string() click to toggle source
# File lib/wikidata_position_history/output_row.rb, line 20
def ordinal_string
  ordinal = current.ordinal or return ''
  "#{ordinal}."
end
party() click to toggle source
# File lib/wikidata_position_history/output_row.rb, line 25
def party
  current.party
end
warnings() click to toggle source
# File lib/wikidata_position_history/output_row.rb, line 44
def warnings
  CHECKS.map { |klass| klass.new(later, current, earlier) }.select(&:problem?)
end