lib/sportradar/api/nfl/player.rb in sportradar-api-0.9.19 vs lib/sportradar/api/nfl/player.rb in sportradar-api-0.9.20
- old
+ new
@@ -34,10 +34,10 @@
@injury = Sportradar::Api::Nfl::Injury.new data["injury"] if data["injury"]
@draft = Sportradar::Api::Nfl::Draft.new data["draft"] if data["draft"]
@seasons = parse_into_array(selector: response["season"], klass: Sportradar::Api::Nfl::Season) if response["season"]
end
def name
- @name ||= [(preferred_name || first_name), last_name].join(' ')
+ preferred_name ? [(preferred_name || first_name), last_name].join(' ') : full_name
end
def age
if birth_date.present?
now = Time.now.utc.to_date