Class: Sportradar::Api::Baseball::Fielder

Inherits:
Data
  • Object
show all
Defined in:
lib/sportradar/api/baseball/fielder.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) ⇒ Fielder

Returns a new instance of Fielder.



7
8
9
10
11
12
# File 'lib/sportradar/api/baseball/fielder.rb', line 7

def initialize(data, **opts)
  @response = data
  # @game     = opts[:game]

  update(data)
end

Instance Attribute Details

#ending_baseObject

Returns the value of attribute ending_base.



5
6
7
# File 'lib/sportradar/api/baseball/fielder.rb', line 5

def ending_base
  @ending_base
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/sportradar/api/baseball/fielder.rb', line 5

def id
  @id
end

#outObject

Returns the value of attribute out.



5
6
7
# File 'lib/sportradar/api/baseball/fielder.rb', line 5

def out
  @out
end

#outcome_idObject

Returns the value of attribute outcome_id.



5
6
7
# File 'lib/sportradar/api/baseball/fielder.rb', line 5

def outcome_id
  @outcome_id
end

#responseObject

Returns the value of attribute response.



5
6
7
# File 'lib/sportradar/api/baseball/fielder.rb', line 5

def response
  @response
end

#starting_baseObject

Returns the value of attribute starting_base.



5
6
7
# File 'lib/sportradar/api/baseball/fielder.rb', line 5

def starting_base
  @starting_base
end

Instance Method Details

#update(data, **opts) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/sportradar/api/baseball/fielder.rb', line 13

def update(data, **opts)
  @id             = data["id"]
  @type           = data["type"]
  @sequence       = data["sequence"]
  @last_name      = data["last_name"]
  @first_name     = data["first_name"]
  @preferred_name = data["preferred_name"]
  @jersey_number  = data["jersey_number"]
end