Class: SpaceshipMissionSimulator::ValidateStartEvent

Inherits:
Object
  • Object
show all
Includes:
Interactor
Defined in:
lib/spaceship_mission_simulator/interactors/validate_start_event.rb

Instance Method Summary collapse

Instance Method Details

#callObject



5
6
7
8
9
10
11
12
# File 'lib/spaceship_mission_simulator/interactors/validate_start_event.rb', line 5

def call
  event = context.path.events.first

  return true if event.planet.key == :earth && event.state == :launch

  msg = 'spaceship mission should start only by launch from Earth'
  context.fail! message: msg
end