lib/sportradar/api/basketball/nba/hierarchy.rb in sportradar-api-0.9.59 vs lib/sportradar/api/basketball/nba/hierarchy.rb in sportradar-api-0.10.0

- old
+ new

@@ -10,13 +10,14 @@ def initialize(data, **opts) @response = data @api = opts[:api] - @id = data["id"] - @name = data["name"] - @alias = data["alias"] - @conferences_hash = create_data({}, data['conference'], klass: Conference, hierarchy: self, api: @api) + @id = data.dig('league', "id") + @name = data.dig('league', "name") + @alias = data.dig('league', "alias") + @season = Season.new(data['season']) if data['season'] + @conferences_hash = create_data({}, data['conferences'], klass: Conference, hierarchy: self, api: @api) end def conferences @conferences_hash.values end def divisions