Class: Assistant::TechnicalSupport::CaseReplayEpisodeChronologyValidator
- Inherits:
-
Object
- Object
- Assistant::TechnicalSupport::CaseReplayEpisodeChronologyValidator
- Defined in:
- app/services/assistant/technical_support/case_replay_episode_chronology_validator.rb
Overview
Ensures Sunny only sees evidence that occurred before the hidden resolution.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(episode:, events:) ⇒ CaseReplayEpisodeChronologyValidator
constructor
A new instance of CaseReplayEpisodeChronologyValidator.
Constructor Details
#initialize(episode:, events:) ⇒ CaseReplayEpisodeChronologyValidator
Returns a new instance of CaseReplayEpisodeChronologyValidator.
11 12 13 14 |
# File 'app/services/assistant/technical_support/case_replay_episode_chronology_validator.rb', line 11 def initialize(episode:, events:) @episode = episode @positions = Array(events).each_with_index.to_h { |event, index| [event.key, index] } end |
Class Method Details
.call(episode:, events:) ⇒ Object
6 7 8 |
# File 'app/services/assistant/technical_support/case_replay_episode_chronology_validator.rb', line 6 def call(episode:, events:) new(episode:, events:).call end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 |
# File 'app/services/assistant/technical_support/case_replay_episode_chronology_validator.rb', line 16 def call return 'Opening and follow-up events are not chronological.' if follow_up_precedes_opening? 'Replay evidence occurs after the hidden outcome.' if replay_follows_outcome? end |