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