Class: SportsDataApi::Nfl::Week
- Inherits:
-
Object
- Object
- SportsDataApi::Nfl::Week
- Defined in:
- lib/sports_data_api/nfl/week.rb
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#season ⇒ Object
readonly
Returns the value of attribute season.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #games ⇒ Object
-
#initialize(json, year, season) ⇒ Week
constructor
A new instance of Week.
Constructor Details
#initialize(json, year, season) ⇒ Week
Returns a new instance of Week.
6 7 8 9 10 11 |
# 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 |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
4 5 6 |
# File 'lib/sports_data_api/nfl/week.rb', line 4 def number @number end |
#season ⇒ Object (readonly)
Returns the value of attribute season.
4 5 6 |
# File 'lib/sports_data_api/nfl/week.rb', line 4 def season @season end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
4 5 6 |
# File 'lib/sports_data_api/nfl/week.rb', line 4 def year @year end |
Instance Method Details
#games ⇒ Object
13 14 15 16 17 |
# File 'lib/sports_data_api/nfl/week.rb', line 13 def games @games ||= json['games'].map do |game| Game.new(game, year: year, season: season, week: number) end end |