class OrlandoEvents::CLI
CLI
Controller
Public Instance Methods
add_attributes_to_months()
click to toggle source
# File lib/orlando_events/cli.rb, line 21 def add_attributes_to_months OrlandoEvents::Event.all.each do |month| events = OrlandoEvents::Scraper.scrape_event_info(month.month_url) month.add_event_details(events) end end
call()
click to toggle source
# File lib/orlando_events/cli.rb, line 4 def call puts "Loading Events..." puts "." make_months puts ".." add_attributes_to_months puts "..." list_dates menu goodbye end
goodbye()
click to toggle source
# File lib/orlando_events/cli.rb, line 75 def goodbye puts "" puts "**********************************".colorize(:yellow) puts "Have a nice day!" puts "Be sure to come back soon for more fun events!" puts "**********************************".colorize(:yellow) puts "" end
list_dates()
click to toggle source
# File lib/orlando_events/cli.rb, line 28 def list_dates puts "***************************************************".colorize(:green) puts "* *".colorize(:green) puts "* Welcome to the Orlando Event Tracker! *".colorize(:green) puts "* *".colorize(:green) puts "***************************************************".colorize(:green) puts "" puts "Downtown has so much to offer everyone, who lives, works and plays in Central Florida. Check out what's going on in and around Downtown Orlando!" puts "" puts "**********************************".colorize(:yellow) @dates = OrlandoEvents::Event.all @dates.each.with_index(1) do |date, i| puts "#{i}. #{date.name}".colorize(:light_cyan) end puts "**********************************".colorize(:yellow) end
make_months()
click to toggle source
# File lib/orlando_events/cli.rb, line 16 def make_months months_array = OrlandoEvents::Scraper.scrape_dates("http://www.downtownorlando.com/future/events/") OrlandoEvents::Event.create_from_collection(months_array) end