class Dcdrinks::CLI

Public Instance Methods

call() click to toggle source
# File lib/dcdrinks/cli.rb, line 3
def call
  puts "Welcome to DC Happy Hours!"
  list_days
  list_happyhours
  goodbye
end
goodbye() click to toggle source
# File lib/dcdrinks/cli.rb, line 42
def goodbye
  puts "Thank you for using DCDrinks! See you next time!"
end
list_days() click to toggle source
# File lib/dcdrinks/cli.rb, line 11
def list_days
  puts "********** Monday(1) **********"
  puts "********** Tuesday(2) **********"
  puts "********** Wednesday(3) **********"
  puts "********** Thursday(4) **********"
  puts "********** Friday(5) **********"
  puts "********** Saturday(6) **********"
  puts "********** Sunday(7) **********"
end
list_happyhours() click to toggle source
# File lib/dcdrinks/cli.rb, line 22
def list_happyhours
  input = nil
  while input != "exit"
    puts "Enter the number of the day to see its listed happy hours, type 'menu' to return to the main page, or type 'exit' when your search is successful."
    input = gets.strip

    if (input.to_i > 0) && (input.to_i < 9)
      Dcdrinks::HappyHour.day_selector(input)
      the_happyhour = Dcdrinks::HappyHour.create_dchappyhour[input.to_i - 1]
    elsif input == "exit"
      break
    elsif input == "menu"
      list_days
    else
      puts "Unsure what you're asking."
    end
  end
end