lib/sportradar/api/basketball/nba/player.rb in sportradar-api-0.9.53 vs lib/sportradar/api/basketball/nba/player.rb in sportradar-api-0.9.54
- old
+ new
@@ -73,10 +73,14 @@
end
self
end
+ def injured?
+ !!(@injury && @injury.out?)
+ end
+
def age
if birth_date.present?
now = Time.now.utc.to_date
dob = birth_date.to_date
now.year - dob.year - ((now.month > dob.month || (now.month == dob.month && now.day >= dob.day)) ? 0 : 1)
@@ -119,10 +123,10 @@
# end
def update_draft(data)
@draft = data['draft'] if data['draft'] # {"team_id"=>"583ec825-fb46-11e1-82cb-f4ce4684ea4c", "year"=>"2012", "round"=>"1", "pick"=>"30"},
end
def update_injuries(data)
- @injuries = data['injuries'] if data['injuries'] #
+ @injury = Injury.new(data['injuries']) if data['injuries']
# {"injury"=>
# {"id"=>"06423591-3fc1-4d2b-8c60-a3f30d735345",
# "comment"=>"Ezeli suffered a setback in his recovery from a procedure on his knee and there is no timetable for his return, according to Jason Quick of csnnw.com.",
# "desc"=>"Knee",
# "status"=>"Out",