lib/sportradar/api/soccer/player.rb in sportradar-api-0.18.0 vs lib/sportradar/api/soccer/player.rb in sportradar-api-0.18.1
- old
+ new
@@ -1,11 +1,11 @@
module Sportradar
module Api
module Soccer
class Player < Data
- attr_reader :id, :league_group, :name, :type, :nationality, :country_code, :height, :weight, :jersey_number, :preferred_foot, :stats, :game_stats, :date_of_birth, :matches_played
+ attr_reader :id, :league_group, :name, :type, :nationality, :country_code, :height, :weight, :jersey_number, :preferred_foot, :stats, :game_stats, :date_of_birth, :matches_played, :starter
alias :position :type
def initialize(data = {}, league_group: nil, **opts)
@response = data
@id = data['id'] if data['id']
@@ -35,9 +35,11 @@
@weight = data['weight'] if data['weight']
@jersey_number = data['jersey_number'] if data['jersey_number']
@preferred_foot = data['preferred_foot'] if data['preferred_foot']
@matches_played = data['matches_played'] if data['matches_played']
@stats = data['statistics'] if data['statistics']
+ @starter = data['starter'] if data.key?('starter')
+
@date_of_birth = Date.parse(data['date_of_birth']) if data['date_of_birth']
set_game_stats(data)
if data['statistics'] && @team
@team.update_player_stats(self, data['statistics'])