Class: WikidataPositionHistory::Check::Overlap
Overview
Does the end date overlap with the successor’s start date?
Instance Method Summary
collapse
#explanation, #initialize
Instance Method Details
#headline ⇒ Object
166
167
168
|
# File 'lib/wikidata_position_history/checks.rb', line 166
def headline
comparable? ? 'Date overlap' : 'Date precision'
end
|
#possible_explanation ⇒ Object
170
171
172
173
|
# File 'lib/wikidata_position_history/checks.rb', line 170
def possible_explanation
format('%s has a {{P|582}} of %s, which %s the {{P|580}} of %s for %s',
current.officeholder.qlink, current.end_date, overlap_explanation, later.start_date, later.officeholder.qlink)
end
|
#problem? ⇒ Boolean
155
156
157
158
159
160
161
162
163
164
|
# File 'lib/wikidata_position_history/checks.rb', line 155
def problem?
return false unless later
next_starts = later.start_date or return false
ends = current.end_date or return false
ends > next_starts
rescue ArgumentError
true
end
|