class SeattleCraftCoffee::Cli
Public Instance Methods
call()
click to toggle source
# File lib/seattle_craft_coffee/cli.rb, line 3 def call greeting run_scraper list menu goodbye end
goodbye()
click to toggle source
# File lib/seattle_craft_coffee/cli.rb, line 69 def goodbye puts "" puts "Goodbye..." puts "" end
greeting()
click to toggle source
# File lib/seattle_craft_coffee/cli.rb, line 11 def greeting puts "Welcome to Seattle's Top Craft Coffee. Here are the top craft coffee brewers in Seattle:" end
invalid_choice()
click to toggle source
# File lib/seattle_craft_coffee/cli.rb, line 59 def invalid_choice puts "Sorry that wasn't a valid choice" menu end
list()
click to toggle source
# File lib/seattle_craft_coffee/cli.rb, line 19 def list SeattleCraftCoffee::Brewers.all.each.with_index(1) do |brewer, index| puts "" puts "#{index}. #{brewer.name}" puts " --Located in #{brewer.neighborhood}" end end
run_scraper()
click to toggle source
# File lib/seattle_craft_coffee/cli.rb, line 15 def run_scraper SeattleCraftCoffee::Scraper.scrape_brewers end
sign_off()
click to toggle source
# File lib/seattle_craft_coffee/cli.rb, line 64 def sign_off puts "" puts "Enjoy your craft coffee! " end