lib/sportradar/api/soccer/player.rb in sportradar-api-0.13.11 vs lib/sportradar/api/soccer/player.rb in sportradar-api-0.13.12

- old
+ new

@@ -8,11 +8,11 @@ def initialize(data = {}, league_group: nil, **opts) @response = data @id = data['id'] if data['id'] @api = opts[:api] - @team = opts[:team] + @team = opts[:team] @league_group = league_group || data['league_group'] || @api&.league_group update(data, **opts) end @@ -37,10 +37,13 @@ @preferred_foot = data['preferred_foot'] if data['preferred_foot'] @matches_played = data['matches_played'] if data['matches_played'] @stats = data['statistics'] if data['statistics'] @date_of_birth = Date.parse(data['date_of_birth']) if data['date_of_birth'] - @team.update_player_stats(self, data['statistics'], opts[:game]) if data['statistics'] && @team + @team.update_player_stats(self, data['statistics']) if data['statistics'] && @team + if opts[:match] + @team.update_player_stats(self, data, opts[:match]) + end end def display_name @name || [@first_name, @last_name].join(' ')