class NYCFlightDeals::CLI

Public Instance Methods

call() click to toggle source
# File lib/nyc_flight_deals/cli.rb, line 3
def call
  list_deals
  menu
  goodbye
end
goodbye() click to toggle source
# File lib/nyc_flight_deals/cli.rb, line 42
def goodbye
  puts "Check back later for more deals. Bye!"
end
list_deals() click to toggle source
# File lib/nyc_flight_deals/cli.rb, line 9
def list_deals
  puts "===== Today's Flight Deals ====="
  puts ""
  @deals = NYCFlightDeals::Deal.recent
  @deals.each.with_index(1) do |deal, i|
    puts "#{i}. #{deal.description}"
  end
  puts ""
end
menu() click to toggle source