class ImpactHubEvents::CLI
Public Instance Methods
call()
click to toggle source
# File lib/impact_hub_events/cli.rb, line 3 def call puts "Upcoming events at Impact Hub Seattle:" scraper = ImpactHubEvents::Scraper.new("https://impacthubseattle.com/events/") scraper.create_events scraper.populate_events self.list_events end
list_detail(event)
click to toggle source
# File lib/impact_hub_events/cli.rb, line 19 def list_detail(event) puts puts Paint["#{event.title}", :green] puts puts Paint["Date: #{event.date}", :blue, :bright] puts Paint["Time: #{event.time}", :blue, :bright] puts Paint["Location: #{event.location}", :blue, :bright] unless event.description.nil? puts puts Paint["#{event.description}", :magenta, :bold] end puts self.list_menu end
list_events()
click to toggle source
# File lib/impact_hub_events/cli.rb, line 11 def list_events ImpactHubEvents::Event.all.each_with_index do |event, index| puts Paint["#{index + 1}. #{event.title}", :green] end puts self.list_menu end