Sha256: e528ccb6e9785b8c602dd7a84a28b05920af09c3b4c5a7d8b2ad0c09e9a50564

Contents?: true

Size: 528 Bytes

Versions: 2

Compression:

Stored size: 528 Bytes

Contents

module NpbHeadline
  class Parameters
    TEAMS = {
      'giants'   => 1,
      'swallows' => 2,
      'baystars' => 3,
      'dragons'  => 4,
      'tigers'   => 5,
      'carp'     => 6,
      'lions'    => 7,
      'fighters' => 8,
      'marines'  => 9,
      'orix'     => 11,
      'hawks'    => 12,
      'eagles'   => 376
    }

    attr_reader :team_id

    def initialize(argv)
      team_name = argv[0]

      raise ArgumentError unless TEAMS.has_key?(team_name)

      @team_id = TEAMS[team_name]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
npb_headline-0.0.2 lib/npb_headline/parameters.rb
npb_headline-0.0.1 lib/npb_headline/parameters.rb