Class: YFantasy::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/y_fantasy/cli.rb

Instance Method Summary collapse

Instance Method Details

#helpObject



29
30
31
# File 'lib/y_fantasy/cli.rb', line 29

def help
  puts self.class.help
end

#nfl_teamsObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/y_fantasy/cli.rb', line 16

def nfl_teams
  require "y_fantasy/ref/nfl"

  YFantasy::Ref::Nfl::TEAM_KEY_MAP.each_with_index do |(key, team), idx|
    if idx.zero?
      puts format("%-15s %-15s %-10s %-10s", "City", "Team Name", "Abbrev", "Yahoo Key")
      puts "-" * 55
    end
    puts format("%-15s %-15s %-10s %-10s", team[:city], team[:team_name], team[:abbrev], key)
  end
end

#versionObject



10
11
12
13
# File 'lib/y_fantasy/cli.rb', line 10

def version
  require "y_fantasy/version"
  puts YFantasy::VERSION
end