Class: Sportradar::Api::Basketball::Injury
- Defined in:
- lib/sportradar/api/basketball/injury.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#descripton ⇒ Object
Returns the value of attribute descripton.
-
#id ⇒ Object
Returns the value of attribute id.
-
#response ⇒ Object
Returns the value of attribute response.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#status ⇒ Object
Returns the value of attribute status.
-
#update_date ⇒ Object
Returns the value of attribute update_date.
Instance Method Summary collapse
-
#initialize(data, **opts) ⇒ Injury
constructor
A new instance of Injury.
- #out? ⇒ Boolean
- #update(data, **opts) ⇒ Object
Methods inherited from Data
#all_attributes, #attributes, #create_data, #parse_into_array, #parse_into_array_with_options, #parse_out_hashes, #structure_links, #update_data
Constructor Details
#initialize(data, **opts) ⇒ Injury
Returns a new instance of Injury.
7 8 9 10 |
# File 'lib/sportradar/api/basketball/injury.rb', line 7 def initialize(data, **opts) @response = data update(data, **opts) end |
Instance Attribute Details
#comment ⇒ Object
Returns the value of attribute comment.
5 6 7 |
# File 'lib/sportradar/api/basketball/injury.rb', line 5 def comment @comment end |
#descripton ⇒ Object
Returns the value of attribute descripton.
5 6 7 |
# File 'lib/sportradar/api/basketball/injury.rb', line 5 def descripton @descripton end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/sportradar/api/basketball/injury.rb', line 5 def id @id end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/sportradar/api/basketball/injury.rb', line 5 def response @response end |
#start_date ⇒ Object
Returns the value of attribute start_date.
5 6 7 |
# File 'lib/sportradar/api/basketball/injury.rb', line 5 def start_date @start_date end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/sportradar/api/basketball/injury.rb', line 5 def status @status end |
#update_date ⇒ Object
Returns the value of attribute update_date.
5 6 7 |
# File 'lib/sportradar/api/basketball/injury.rb', line 5 def update_date @update_date end |
Instance Method Details
#out? ⇒ Boolean
21 22 23 |
# File 'lib/sportradar/api/basketball/injury.rb', line 21 def out? @status == 'Out' end |
#update(data, **opts) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/sportradar/api/basketball/injury.rb', line 12 def update(data, **opts) @id = data.last&.dig('id') @comment = data.last&.dig('comment') @descripton = data.last&.dig('desc') @status = data.last&.dig('status') @start_date = data.last&.dig('start_date') @update_date = data.last&.dig('update_date') end |