class WhyImBrokeCli::CLI
Public Instance Methods
call()
click to toggle source
# File lib/why_im_broke_cli/cli.rb, line 3 def call welcome menu end
goodbye()
click to toggle source
# File lib/why_im_broke_cli/cli.rb, line 63 def goodbye puts "Goodbye Friend" end
list()
click to toggle source
# File lib/why_im_broke_cli/cli.rb, line 32 def list WhyImBrokeCli::Item.list puts "You can enter a number to learn more about an event:" input = gets.strip.downcase if input.to_i <= 0 || input.to_i > 102 puts "Sorry try again" else WhyImBrokeCli::Item.details(input.to_i - 1) end end
search()
click to toggle source
# File lib/why_im_broke_cli/cli.rb, line 43 def search puts "You can search by type of event:" puts "(Bars, Attractions, Restaurants, Museums, Movie, Comedy, Theater, Things to do, Music, Sports, Shopping, Nightlife, Health)" input = gets.strip.capitalize if WhyImBrokeCli::Item.search_by_type(input) == [] puts "Sorry try again" else x = WhyImBrokeCli::Item.search_by_type(input) puts "You can enter a number to learn more about an event:" input = gets.strip.to_i if input <= 0 || input > x.size puts "Sorry try again" else WhyImBrokeCli::Item.details_for_search(x, input.to_i - 1) end end end
welcome()
click to toggle source
# File lib/why_im_broke_cli/cli.rb, line 8 def welcome puts "Welcome to This Is Why I'm Broke." puts "These are the 101 best things to do in NYC plus a little extra:" WhyImBrokeCli::Scraper.activate end