lib/sportradar/api/basketball/nba/season.rb in sportradar-api-0.10.6 vs lib/sportradar/api/basketball/nba/season.rb in sportradar-api-0.10.7
- old
+ new
@@ -14,20 +14,30 @@
@alias = data.dig('league', 'alias')
@year = data.dig('season', 'year')
@type = data.dig('season', 'type')
- @games_hash = {}
+ @games_hash = {}
+ @series_hash = {}
- update_games(data['games'])
+ update_games(data['games']) if data['games']
+ update_series(data['series']) if data['series']
end
def games
@games_hash.values
end
def update_games(data)
create_data(@games_hash, data, klass: Game, api: @api, season: self)
+ end
+
+ def series
+ @series_hash.values
+ end
+
+ def update_series(data)
+ create_data(@series_hash, data, klass: Series, api: @api, season: self)
end
end
end
end