class Trendster::CLI
Public Instance Methods
call()
click to toggle source
domino order of methods to run
# File lib/trendster/cli.rb, line 5 def call make_events list_events menu goodbye end
goodbye()
click to toggle source
# File lib/trendster/cli.rb, line 53 def goodbye puts "See you next time for more library events!" end
list_events()
click to toggle source
should list current library events
# File lib/trendster/cli.rb, line 19 def list_events puts "Here are the most recent events at the Cuyahoga County Public Library:" all_events = Trendster::Event.all all_events.each do |event| puts "#{all_events.index(event) + 1}. #{event.name}" end end
make_events()
click to toggle source
# File lib/trendster/cli.rb, line 12 def make_events events_array = Trendster::Scraper.scrape_library_page Trendster::Event.create_from_collection(events_array) end