lib/sportradar/api/basketball/nba/team.rb in sportradar-api-0.10.9 vs lib/sportradar/api/basketball/nba/team.rb in sportradar-api-0.10.10
- old
+ new
@@ -1,16 +1,21 @@
module Sportradar
module Api
module Basketball
class Nba
class Team < Sportradar::Api::Basketball::Team
+
+
@all_hash = {}
def self.new(data, **opts)
existing = @all_hash[data['id']]
if existing
existing.update(data, **opts)
existing
else
+ unless data['id']
+ data.merge!(data.delete('team')) if data['team']
+ end
@all_hash[data['id']] = super
end
end
def self.all
@all_hash.values
\ No newline at end of file