class HappyHour::CLI
Public Instance Methods
bar_list()
click to toggle source
# File lib/happy_hour/cli.rb, line 16 def bar_list HappyHour::Bar.all.each.with_index(1) do |bar, i| puts "#{i}. #{bar.name}" #binding.pry end end
call()
click to toggle source
# File lib/happy_hour/cli.rb, line 3 def call puts "*************************************" puts "" puts "Welcome! Let's get your Happy on!!!" puts "-------------------------------------" puts "-------------------------------------" HappyHour::Bar.scrape_bars bar_list more_info goodbye end
goodbye()
click to toggle source
# File lib/happy_hour/cli.rb, line 51 def goodbye puts "" puts "Thanks for visiting! Come back soon!!!" puts "" end
more_info()
click to toggle source
# File lib/happy_hour/cli.rb, line 23 def more_info input = nil while input != 'exit' puts "" puts "Enter number for details for bar of choice:" puts "" input = gets.strip.downcase if input.to_i > 0 && input.to_i <= HappyHour::Bar.all.length bar = HappyHour::Bar.all[input.to_i] puts "" puts "#{bar.name}" puts "************************" puts "#{bar.description}" puts "************************" puts "" puts "For main list of bars, type 'list', to leave, type 'exit'." elsif input == 'list' bar_list elsif input == 'exit' else puts "" puts "Oops! Think you pressed the wrong number." #binding.pry end end end