class Mlb::CLI
our Cli Controller
Public Instance Methods
call()
click to toggle source
# File lib/mlb/cli.rb, line 5 def call puts "Today's final scores." Mlb::Scraper.scrape_games list_games menu end
goodbye()
click to toggle source
# File lib/mlb/cli.rb, line 67 def goodbye puts "Thankyou! Have a great day!".yellow exit end
list_games()
click to toggle source
# File lib/mlb/cli.rb, line 12 def list_games Mlb::Game.all.each.with_index(1) do |game, i| puts "#{i}) #{game.winner}:#{game.score_w} #{game.loser}:#{game.score_l}" end end
print_more_info(input)
click to toggle source
# File lib/mlb/cli.rb, line 62 def print_more_info(input) games = Mlb::Game.all puts "winning pitcher".green + ": #{games[input].pitcher_w}".cyan + " losing pitcher".red + ": #{games[input].pitcher_l}".cyan + " #{games[input].save}" end