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