Class: WikidataPositionHistory::Check::WrongPredecessor

Inherits:
WikidataPositionHistory::Check show all
Defined in:
lib/wikidata_position_history/checks.rb

Overview

Does the ‘replaces’ match the previous item in the list?

Instance Method Summary collapse

Methods inherited from WikidataPositionHistory::Check

#explanation, #initialize

Constructor Details

This class inherits a constructor from WikidataPositionHistory::Check

Instance Method Details

#headlineObject



99
100
101
# File 'lib/wikidata_position_history/checks.rb', line 99

def headline
  'Inconsistent predecessor'
end

#possible_explanationObject



103
104
105
# File 'lib/wikidata_position_history/checks.rb', line 103

def possible_explanation
  "#{current.officeholder.qlink} has a {{P|1365}} of #{predecessor_qlink}, but follows #{earlier.officeholder.qlink} here"
end

#problem?Boolean

Returns:

  • (Boolean)


95
96
97
# File 'lib/wikidata_position_history/checks.rb', line 95

def problem?
  earlier_holder? && !!predecessor_qlink && (earlier.officeholder.qlink != predecessor_qlink)
end