class BeerMe::CLI
Public Instance Methods
call()
click to toggle source
# File lib/beer_me/cli.rb, line 6 def call doc = Nokogiri::HTML(open("https://www.ratebeer.com/Ratings/TopOfTheMonth.asp")) month_title = doc.css("h1").text puts "" puts "*****************************************" puts "******** " + month_title + "*********" puts "*****************************************" puts "" BeerMe::Beer.scrape_beers_site list_beers menu goodbye end
goodbye()
click to toggle source
# File lib/beer_me/cli.rb, line 53 def goodbye puts "See you next month for the new best beers!" end
list_beers()
click to toggle source
# File lib/beer_me/cli.rb, line 20 def list_beers BeerMe::Beer.all.each.with_index(1) do |beer,i| puts "#{i}. #{beer.name}" end end