Class: WikidataPositionHistory::Check::Overlap

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

Overview

Does the end date overlap with the successor’s start date?

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



133
134
135
# File 'lib/wikidata_position_history/checks.rb', line 133

def headline
  comparable? ? 'Date overlap' : 'Date precision'
end

#possible_explanationObject



137
138
139
# File 'lib/wikidata_position_history/checks.rb', line 137

def possible_explanation
  "#{current.item} has a {{P|582}} of #{current.end_date}, which #{overlap_explanation} the {{P|580}} of #{later.start_date} for #{later.item}"
end

#problem?Boolean

Returns:

  • (Boolean)


124
125
126
127
128
129
130
131
# File 'lib/wikidata_position_history/checks.rb', line 124

def problem?
  return false unless later

  ends = current.end_date or return false
  ends > later.start_date
rescue ArgumentError
  true
end