Sha256: 351e2c9325b10aa367f7db17afbc481333714edf0eb144029ddfd4e03cc276b8

Contents?: true

Size: 576 Bytes

Versions: 21

Compression:

Stored size: 576 Bytes

Contents

module SportsDataApi
  module Ncaafb
    class Season
      attr_reader :year, :type, :weeks

      def initialize(season_hash)
        @weeks = []
        @year = season_hash['season']
        @type = season_hash['type'].to_sym
        @weeks = season_hash['weeks'].map do |week_hash|
          Week.new(@year, @type, week_hash)
        end
      end

      ##
      # Check if the requested season is a valid
      # Ncaafb season type.
      #
      # The only valid types are: :REG
      def self.valid?(season)
        [:REG].include?(season)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
sports_data_api-0.15.3 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.15.2 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.15.1 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.15.0 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.14.1 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.14.0 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.13.0 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.12.1 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.12.0 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.11.6 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.11.5 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.11.3 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.11.2 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.11.1 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.11.0 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.10.1 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.10.0 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.9.2 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.2.4 lib/sports_data_api/ncaafb/season.rb
sports_data_api-0.2.3 lib/sports_data_api/ncaafb/season.rb