class SdEvents::CLI
Public Class Methods
no_events()
click to toggle source
# File lib/sd_events/cli.rb, line 95 def self.no_events puts "" puts "Uh oh, looks like there are no events for that time...".colorize(:magenta) puts "Please return tomorrow for more events.".colorize(:magenta) puts "" puts "To see the menu again, type 'menu' or type 'exit':".colorize(:red) input = gets.downcase.strip if input == "menu" self.new.list_menu elsif input == "exit" self.new.goodbye else "Not sure what you're asking, here is the menu again:".colorize(:red) self.new.list_menu end end
Public Instance Methods
call()
click to toggle source
# File lib/sd_events/cli.rb, line 3 def call start end
display_events()
click to toggle source
# File lib/sd_events/cli.rb, line 56 def display_events SdEvents::Events.all.each.with_index(1) do |event, i| puts "#{i}." puts "Event: #{event.name.upcase}".colorize(:magenta) puts "Venue: #{event.venue}".colorize(:magenta) puts "Time: #{event.time}".colorize(:magenta) puts "" end end
goodbye()
click to toggle source
# File lib/sd_events/cli.rb, line 112 def goodbye puts "Thanks for visiting SD Events!".colorize(:blue) exit end
start()
click to toggle source
# File lib/sd_events/cli.rb, line 7 def start puts "" puts "******* Events Happening Now in San Diego *******".colorize(:blue) puts "" list_menu end