Sha256: e8b7026d9bb565ced62d1cf2a3d49ce3980a012c16e880e69b9e0dbf468ce213

Contents?: true

Size: 422 Bytes

Versions: 2

Compression:

Stored size: 422 Bytes

Contents

module SportsDataApi
  module Nfl
    class Season
      attr_reader :year, :type

      def initialize(json)
        @json = json
        @id = json['id']
        @year = json['year']
        @type = json['type'].to_sym
      end

      def weeks
        @weeks ||= json.fetch('weeks', []).map do |week|
          Week.new(week, year, type)
        end
      end

      private

      attr_reader :json
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sports_data_api-0.15.3 lib/sports_data_api/nfl/season.rb
sports_data_api-0.15.2 lib/sports_data_api/nfl/season.rb