Source

moon_mission / launch.rb

Full commit
class Launch

  require 'lib/rocket'
  require 'lib/lander'
  require 'lib/mission'
  require 'lib/crew'
  
  def initialize
    @rocket = Rocket.new
    @lander = Lander.new
    @crew = Crew.new("Neil", "Michael", "Buzz")
    @mission = Mission.new("Apollo 11", "The Moon")
  end
  
  def mission_data
    "The #{@mission.name} mission is headed for #{@mission.destination}."
  end
  
  def countdown
    10.downto(0) do |i|
      puts i
      case i
        when 8 : @rocket.ignition_sequence_start
        when 0 : @rocket.liftoff
      end
    end
  end
  
end