Class: SpaceshipMissionSimulator::ValidateFinishEvent
- Inherits:
-
Object
- Object
- SpaceshipMissionSimulator::ValidateFinishEvent
- Includes:
- Interactor
- Defined in:
- lib/spaceship_mission_simulator/interactors/validate_finish_event.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/spaceship_mission_simulator/interactors/validate_finish_event.rb', line 5 def call event = context.path.events.last return true if event.planet.key == :earth && event.state == :land msg = 'spaceship mission should finish only by land on Earth' context.fail! message: msg end |