Class: Sportradar::Api::Baseball::Event::Lineup

Inherits:
Data
  • Object
show all
Defined in:
lib/sportradar/api/baseball/events/lineup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6

def description
  @description
end

#eventObject

Returns the value of attribute event.



6
7
8
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6

def event
  @event
end

#first_nameObject

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_idObject

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

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6

def id
  @id
end

#jersey_numberObject

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_nameObject

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

#orderObject

Returns the value of attribute order.



6
7
8
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6

def order
  @order
end

#outcomeObject

Returns the value of attribute outcome.



6
7
8
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6

def outcome
  @outcome
end

#player_idObject

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

#positionObject

Returns the value of attribute position.



6
7
8
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6

def position
  @position
end

#preferred_nameObject

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

#responseObject

Returns the value of attribute response.



6
7
8
# File 'lib/sportradar/api/baseball/events/lineup.rb', line 6

def response
  @response
end

#team_idObject

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_keyObject



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