lib/sportradar/api/soccer/player.rb in sportradar-api-0.13.5 vs lib/sportradar/api/soccer/player.rb in sportradar-api-0.13.6

- old
+ new

@@ -32,25 +32,23 @@ @height = data['height'] if data['height'] @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'] - @date_of_birth = Date.parse(data['date_of_birth']) if data['date_of_birth'] end def display_name @name || [@first_name, @last_name].join(' ') end def first_name - @first_name || (@name && @name.split(', ')[1]) + @name.split()[1] end def last_name - @last_name || (@name && @name.split(', ')[0]) + @name.split()[0].delete(',') end def api @api || Sportradar::Api::Soccer::Api.new(league_group: @league_group) end