Class: Sportradar::Api::Baseball::Event::Lineup
- Defined in:
- lib/sportradar/api/baseball/events/lineup.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#event ⇒ Object
Returns the value of attribute event.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#hitter_id ⇒ Object
Returns the value of attribute hitter_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#jersey_number ⇒ Object
Returns the value of attribute jersey_number.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#order ⇒ Object
Returns the value of attribute order.
-
#outcome ⇒ Object
Returns the value of attribute outcome.
-
#player_id ⇒ Object
Returns the value of attribute player_id.
-
#position ⇒ Object
Returns the value of attribute position.
-
#preferred_name ⇒ Object
Returns the value of attribute preferred_name.
-
#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
-
#initialize(data, **opts) ⇒ Lineup
constructor
A new instance of Lineup.
- #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) ⇒ Lineup
Returns a new instance of Lineup.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 8 def initialize(data, **opts) @response = data @event = opts[:event] @description = data["description"] @id = data["id"] @player_id = data["player_id"] @order = data["order"] @position = data["position"] @team_id = data["team_id"] @last_name = data["last_name"] @first_name = data["first_name"] @preferred_name = data["preferred_name"] @jersey_number = data["jersey_number"] # update(data) end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6 def description @description end |
#event ⇒ Object
Returns the value of attribute event.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6 def event @event end |
#first_name ⇒ Object
Returns the value of attribute first_name.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6 def first_name @first_name end |
#hitter_id ⇒ Object
Returns the value of attribute hitter_id.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6 def hitter_id @hitter_id end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6 def id @id end |
#jersey_number ⇒ Object
Returns the value of attribute jersey_number.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6 def jersey_number @jersey_number end |
#last_name ⇒ Object
Returns the value of attribute last_name.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6 def last_name @last_name end |
#order ⇒ Object
Returns the value of attribute order.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6 def order @order end |
#outcome ⇒ Object
Returns the value of attribute outcome.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6 def outcome @outcome end |
#player_id ⇒ Object
Returns the value of attribute player_id.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6 def player_id @player_id end |
#position ⇒ Object
Returns the value of attribute position.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6 def position @position end |
#preferred_name ⇒ Object
Returns the value of attribute preferred_name.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6 def preferred_name @preferred_name end |
#response ⇒ Object
Returns the value of attribute response.
6 7 8 |
# File 'lib/sportradar/api/baseball/events/lineup.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/lineup.rb', line 6 def team_id @team_id end |
Instance Method Details
#data_key ⇒ Object
30 31 32 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 30 def data_key 'lineup' end |
#update(data, **opts) ⇒ Object
25 26 27 28 |
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 25 def update(data, **opts) # lineup = event.half_inning.inning.game.lineup # lineup.update_from_lineup_event(data) end |