Class: Sportradar::Api::Football::MiscStatistics

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

Returns a new instance of MiscStatistics.



86
87
88
89
90
91
# File 'lib/sportradar/api/football/play_statistics.rb', line 86

def initialize(data)
  @response = data
  @yards          = data['yards'] || data['yds']
  @team           = OpenStruct.new(data['team']) if data['team']
  @player         = OpenStruct.new(data['player']) if data['player']
end

Instance Attribute Details

#playerObject (readonly)

Returns the value of attribute player.



85
86
87
# File 'lib/sportradar/api/football/play_statistics.rb', line 85

def player
  @player
end

#teamObject (readonly)

Returns the value of attribute team.



85
86
87
# File 'lib/sportradar/api/football/play_statistics.rb', line 85

def team
  @team
end

#yardsObject (readonly)

Returns the value of attribute yards.



85
86
87
# File 'lib/sportradar/api/football/play_statistics.rb', line 85

def yards
  @yards
end