lib/sportradar/api/basketball/ncaamb/player.rb in sportradar-api-0.12.0 vs lib/sportradar/api/basketball/ncaamb/player.rb in sportradar-api-0.12.1
- old
+ new
@@ -1,11 +1,11 @@
module Sportradar
module Api
module Basketball
class Ncaamb
class Player < Data
- attr_accessor :response, :id, :number, :full_name, :first_name, :last_name, :position, :birth_place, :college, :height, :weight, :averages, :totals, :draft
+ attr_accessor :response, :id, :number, :full_name, :first_name, :last_name, :position, :birth_place, :college, :height, :weight, :averages, :totals, :draft, :stats
# @all_hash = {}
# def self.new(data, **opts)
# existing = @all_hash[data['id']]
# if existing
# existing.update(data, **opts)
@@ -69,10 +69,14 @@
# update_draft(data)
@team.update_player_stats(self, data['statistics'], opts[:game]) if data['statistics']
if avgs = data['average']
@totals = data['total']
- @averages = avgs.except(:player)
+ @averages = avgs
+ @stats = {
+ 'total' => @totals,
+ 'averages' => @averages,
+ }
@team.update_player_stats(self, avgs)
end
self
end