Class: Sportradar::Api::Baseball::Error

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

Returns a new instance of Error.



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

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

  update(data)
end

Instance Attribute Details

#first_nameObject

Returns the value of attribute first_name.



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

def first_name
  @first_name
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#jersey_numberObject

Returns the value of attribute jersey_number.



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

def jersey_number
  @jersey_number
end

#last_nameObject

Returns the value of attribute last_name.



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

def last_name
  @last_name
end

#preferred_nameObject

Returns the value of attribute preferred_name.



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

def preferred_name
  @preferred_name
end

#responseObject

Returns the value of attribute response.



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

def response
  @response
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#update(data, **opts) ⇒ Object



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

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