class SportsDataApi::Nfl::Season
Attributes
json[R]
type[R]
year[R]
Public Class Methods
new(json)
click to toggle source
# File lib/sports_data_api/nfl/season.rb, line 6 def initialize(json) @json = json @id = json['id'] @year = json['year'] @type = json['type'].to_sym end
Public Instance Methods
weeks()
click to toggle source
# File lib/sports_data_api/nfl/season.rb, line 13 def weeks @weeks ||= json.fetch('weeks', []).map do |week| Week.new(week, year, type) end end