Class: Sportradar::Api::Football::Event
- Defined in:
- lib/sportradar/api/football/event.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#alt_description ⇒ Object
Returns the value of attribute alt_description.
-
#clock ⇒ Object
Returns the value of attribute clock.
-
#description ⇒ Object
Returns the value of attribute description.
-
#event_type ⇒ Object
Returns the value of attribute event_type.
-
#id ⇒ Object
Returns the value of attribute id.
-
#reference ⇒ Object
Returns the value of attribute reference.
-
#response ⇒ Object
Returns the value of attribute response.
-
#sequence ⇒ Object
Returns the value of attribute sequence.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #events ⇒ Object
- #halftime? ⇒ Boolean
-
#initialize(data, **opts) ⇒ Event
constructor
A new instance of Event.
- #over? ⇒ Boolean
- #plays ⇒ Object
- #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) ⇒ Event
Returns a new instance of Event.
7 8 9 10 11 |
# File 'lib/sportradar/api/football/event.rb', line 7 def initialize(data, **opts) @response = data @id = data["id"] update(data, **opts) end |
Instance Attribute Details
#alt_description ⇒ Object
Returns the value of attribute alt_description.
5 6 7 |
# File 'lib/sportradar/api/football/event.rb', line 5 def alt_description @alt_description end |
#clock ⇒ Object
Returns the value of attribute clock.
5 6 7 |
# File 'lib/sportradar/api/football/event.rb', line 5 def clock @clock end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/sportradar/api/football/event.rb', line 5 def description @description end |
#event_type ⇒ Object
Returns the value of attribute event_type.
5 6 7 |
# File 'lib/sportradar/api/football/event.rb', line 5 def event_type @event_type end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/sportradar/api/football/event.rb', line 5 def id @id end |
#reference ⇒ Object
Returns the value of attribute reference.
5 6 7 |
# File 'lib/sportradar/api/football/event.rb', line 5 def reference @reference end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/sportradar/api/football/event.rb', line 5 def response @response end |
#sequence ⇒ Object
Returns the value of attribute sequence.
5 6 7 |
# File 'lib/sportradar/api/football/event.rb', line 5 def sequence @sequence end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/sportradar/api/football/event.rb', line 5 def type @type end |
Instance Method Details
#events ⇒ Object
26 27 28 |
# File 'lib/sportradar/api/football/event.rb', line 26 def events [self] end |
#halftime? ⇒ Boolean
32 33 34 |
# File 'lib/sportradar/api/football/event.rb', line 32 def halftime? false end |
#over? ⇒ Boolean
29 30 31 |
# File 'lib/sportradar/api/football/event.rb', line 29 def over? false # TODO end |
#plays ⇒ Object
23 24 25 |
# File 'lib/sportradar/api/football/event.rb', line 23 def plays [] end |
#update(data, **opts) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sportradar/api/football/event.rb', line 12 def update(data, **opts) @sequence = data["sequence"] @reference = data["reference"] @clock = data["clock"] @type = data["type"] @event_type = data["event_type"] @description = data["description"] || data["summary"] @alt_description = data["alt_description"] self end |