Class: SpaceshipMissionSimulator::Path
- Inherits:
-
Struct
- Object
- Struct
- SpaceshipMissionSimulator::Path
- Defined in:
- lib/spaceship_mission_simulator/path.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
-
#raw_data ⇒ Object
Returns the value of attribute raw_data.
Instance Method Summary collapse
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events
2 3 4 |
# File 'lib/spaceship_mission_simulator/path.rb', line 2 def events @events end |
#raw_data ⇒ Object
Returns the value of attribute raw_data
2 3 4 |
# File 'lib/spaceship_mission_simulator/path.rb', line 2 def raw_data @raw_data end |
Instance Method Details
#finish_event? ⇒ Boolean
7 8 9 |
# File 'lib/spaceship_mission_simulator/path.rb', line 7 def finish_event? events.size == 1 end |
#fresh_event_consistent? ⇒ Boolean
3 4 5 |
# File 'lib/spaceship_mission_simulator/path.rb', line 3 def fresh_event_consistent? finish_event? || events[0].state != events[1].state end |
#print ⇒ Object
15 16 17 |
# File 'lib/spaceship_mission_simulator/path.rb', line 15 def print events.map { |event| "#{event.state} #{event.planet.name}" }.join ', ' end |
#start_event? ⇒ Boolean
11 12 13 |
# File 'lib/spaceship_mission_simulator/path.rb', line 11 def start_event? events.size == raw_data.size end |