Sha256: 5a890324e8011efd209b958b491b97fe0a6775f173bc859fe8927294be9bcf8e

Contents?: true

Size: 300 Bytes

Versions: 10

Compression:

Stored size: 300 Bytes

Contents

module MLBGameday
  class League
    attr_reader :name, :divisions

    def initialize(name, divisions)
      @name = name
      @divisions = divisions
    end

    def division(name)
      fail 'Invalid division' unless %i(East Central West).include?(name)

      @divisions[name]
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mlb_gameday-0.1.9 lib/mlb_gameday/league.rb
mlb_gameday-0.1.8 lib/mlb_gameday/league.rb
mlb_gameday-0.1.7 lib/mlb_gameday/league.rb
mlb_gameday-0.1.6 lib/mlb_gameday/league.rb
mlb_gameday-0.1.5 lib/mlb_gameday/league.rb
mlb_gameday-0.1.4 lib/mlb_gameday/league.rb
mlb_gameday-0.1.3 lib/mlb_gameday/league.rb
mlb_gameday-0.1.2 lib/mlb_gameday/league.rb
mlb_gameday-0.1.1 lib/mlb_gameday/league.rb
mlb_gameday-0.1.0 lib/mlb_gameday/league.rb