Sha256: a28af3741d16bdcb18586b5276f6f0110bfa46ecf3d897233d23b54469f0cdd8
Contents?: true
Size: 594 Bytes
Versions: 19
Compression:
Stored size: 594 Bytes
Contents
module SportsDataApi module Nfl 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 # NFL season type. # # The only valid types are: :PRE, :REG, :PST def self.valid?(season) [:PRE, :REG, :PST].include?(season) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems