lib/sportradar/api/basketball/ncaamb/team.rb in sportradar-api-0.10.0 vs lib/sportradar/api/basketball/ncaamb/team.rb in sportradar-api-0.10.1
- old
+ new
@@ -2,9 +2,22 @@
module Api
module Basketball
class Ncaamb
class Team < Sportradar::Api::Basketball::Team
@all_hash = {}
+ def self.new(data, **opts)
+ existing = @all_hash[data['id']]
+ binding.pry if data['id'] == "632616c5-2dbb-4017-a449-c9dfc303f026"
+ if existing
+ existing.update(data, **opts)
+ existing
+ else
+ @all_hash[data['id']] = super
+ end
+ end
+ def self.all
+ @all_hash.values
+ end
def player_class
Player
end
\ No newline at end of file