class WaTrailRuns::CLI

CLI Controller

Public Instance Methods

call() click to toggle source
# File lib/wa_trail_runs/cli.rb, line 4
def call
  puts "Welcome to WaTrailRuns, your go-to source for upcoming trail races in Washington State!"
  sleep 0.5
  WaTrailRuns::Scraper.new.scrape_evergreen
  WaTrailRuns::Scraper.new.scrape_northwest
  list_runs
  menu
  goodbye
end
goodbye() click to toggle source
# File lib/wa_trail_runs/cli.rb, line 41
def goodbye
  puts "Happy trails!"
end
list_runs() click to toggle source
# File lib/wa_trail_runs/cli.rb, line 14
def list_runs
  puts "Check out the upcoming runs!"
  WaTrailRuns::Run.all.each.with_index(1) do |run, index|
    puts "#{index}. #{run.title} - #{run.date}"
  end
end
menu() click to toggle source