Class: Sportradar::Api::Baseball::Event::WarmingUp
- Defined in:
- lib/sportradar/api/baseball/events/warming_up.rb
Instance Attribute Summary collapse
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#player_id ⇒ Object
Returns the value of attribute player_id.
-
#response ⇒ Object
Returns the value of attribute response.
-
#team_id ⇒ Object
Returns the value of attribute team_id.
Instance Method Summary collapse
- #data_key ⇒ Object
- #description ⇒ Object
-
#initialize(data, **opts) ⇒ WarmingUp
constructor
A new instance of WarmingUp.
- #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) ⇒ WarmingUp
Returns a new instance of WarmingUp.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sportradar/api/baseball/events/warming_up.rb', line 8 def initialize(data, **opts) @response = data # @api = opts[:api] # @half_inning = opts[:half_inning] @event = opts[:event] @id = data["id"] @type = data['type'] @first_name = data['first_name'] if data['first_name'] @last_name = data['last_name'] if data['last_name'] @player_id = data['player_id'] if data['player_id'] @team_id = data['team_id'] if data['team_id'] @preferred_name = data['preferred_name'] if data['preferred_name'] update(data) end |
Instance Attribute Details
#first_name ⇒ Object
Returns the value of attribute first_name.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/warming_up.rb', line 6 def first_name @first_name end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/warming_up.rb', line 6 def id @id end |
#last_name ⇒ Object
Returns the value of attribute last_name.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/warming_up.rb', line 6 def last_name @last_name end |
#player_id ⇒ Object
Returns the value of attribute player_id.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/warming_up.rb', line 6 def player_id @player_id end |
#response ⇒ Object
Returns the value of attribute response.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/warming_up.rb', line 6 def response @response end |
#team_id ⇒ Object
Returns the value of attribute team_id.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/warming_up.rb', line 6 def team_id @team_id end |
Instance Method Details
#data_key ⇒ Object
31 32 33 |
# File 'lib/sportradar/api/baseball/events/warming_up.rb', line 31 def data_key 'warming_up' end |
#description ⇒ Object
23 24 25 |
# File 'lib/sportradar/api/baseball/events/warming_up.rb', line 23 def description "#{(@preferred_name || @first_name)} #{@last_name} is now warming up in the bullpen." end |
#update(data, **opts) ⇒ Object
27 28 29 |
# File 'lib/sportradar/api/baseball/events/warming_up.rb', line 27 def update(data, **opts) # parse pitches end |