Class: SportsDataApi::Ncaafb::Games
- Inherits:
-
Object
- Object
- SportsDataApi::Ncaafb::Games
- Includes:
- Enumerable
- Defined in:
- lib/sports_data_api/ncaafb/games.rb
Instance Attribute Summary collapse
-
#games ⇒ Object
readonly
Returns the value of attribute games.
-
#season ⇒ Object
readonly
Returns the value of attribute season.
-
#week ⇒ Object
readonly
Returns the value of attribute week.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(year, season, week, games_hash) ⇒ Games
constructor
A new instance of Games.
Constructor Details
#initialize(year, season, week, games_hash) ⇒ Games
7 8 9 10 11 12 13 14 15 |
# File 'lib/sports_data_api/ncaafb/games.rb', line 7 def initialize(year, season, week, games_hash) @year = year @season = season @week = week @games = games_hash['games'].map do |game_hash| Game.new(@year, @season, @week, game_hash) end end |
Instance Attribute Details
#games ⇒ Object (readonly)
Returns the value of attribute games.
5 6 7 |
# File 'lib/sports_data_api/ncaafb/games.rb', line 5 def games @games end |
#season ⇒ Object (readonly)
Returns the value of attribute season.
5 6 7 |
# File 'lib/sports_data_api/ncaafb/games.rb', line 5 def season @season end |
#week ⇒ Object (readonly)
Returns the value of attribute week.
5 6 7 |
# File 'lib/sports_data_api/ncaafb/games.rb', line 5 def week @week end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
5 6 7 |
# File 'lib/sports_data_api/ncaafb/games.rb', line 5 def year @year end |
Instance Method Details
#each(&block) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/sports_data_api/ncaafb/games.rb', line 17 def each &block @games.each do |game| if block_given? block.call game else yield game end end end |