lib/sportradar/api/basketball/nba/season.rb in sportradar-api-0.9.59 vs lib/sportradar/api/basketball/nba/season.rb in sportradar-api-0.10.0
- old
+ new
@@ -1,22 +1,22 @@
module Sportradar
module Api
module Basketball
class Nba
class Season < Basketball::Season
- attr_accessor :response
+ attr_accessor :response, :id, :name, :alias
def initialize(data, **opts)
@response = data
@api = opts[:api]
- @id = response['id']
- @name = response['name']
- @alias = response['alias']
+ @id = data.dig('league', 'id')
+ @name = data.dig('league', 'name')
+ @alias = data.dig('league', 'alias')
@games_hash = {}
- update_games(data.dig('season_schedule', 'games', 'game'))
+ update_games(data['games'])
end
def games
@games_hash.values
end
@@ -37,6 +37,7 @@
__END__
sd = sr.daily_schedule;
sr = Sportradar::Api::Basketball::Nba.new
+ss = sr.standings;
ss = sr.schedule;