Class: HappyHour::CLI
- Inherits:
-
Object
- Object
- HappyHour::CLI
- Defined in:
- lib/happy_hour/cli.rb
Instance Method Summary collapse
Instance Method Details
#bar_list ⇒ Object
16 17 18 19 20 21 |
# File 'lib/happy_hour/cli.rb', line 16 def HappyHour::Bar.all.each.with_index(1) do |, i| puts "#{i}. #{.name}" #binding.pry end end |
#call ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/happy_hour/cli.rb', line 3 def call puts "*************************************" puts "" puts "Welcome! Let's get your Happy on!!!" puts "-------------------------------------" puts "-------------------------------------" HappyHour::Bar. more_info goodbye end |
#goodbye ⇒ Object
51 52 53 54 55 |
# File 'lib/happy_hour/cli.rb', line 51 def goodbye puts "" puts "Thanks for visiting! Come back soon!!!" puts "" end |
#more_info ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# 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 = HappyHour::Bar.all[input.to_i] puts "" puts "#{.name}" puts "************************" puts "#{.description}" puts "************************" puts "" puts "For main list of bars, type 'list', to leave, type 'exit'." elsif input == 'list' elsif input == 'exit' else puts "" puts "Oops! Think you pressed the wrong number." #binding.pry end end end |