Class: Sportradar::Api::Football::PlayKickStatistics

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) ⇒ PlayKickStatistics

Returns a new instance of PlayKickStatistics.



341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/sportradar/api/football/play_statistics.rb', line 341

def initialize(data)
  @response = data
  @endzone      = data['endzone']
  @inside_20    = data['inside_20']   || data['in20']
  @attempt      = data['attempt']     || data['kicks']
  @returned     = data['ret']
  @yards        = data['yards']       || data['yds']
  @gross_yards  = data['gross_yards'] || data['net_yds']
  @touchback    = data['touchback']   || data['tb']
  @team         = OpenStruct.new(data['team']) if data['team']
  @player       = OpenStruct.new(data['player']) if data['player']
  @nullified    = data['nullified']
end

Instance Attribute Details

#attemptObject

Returns the value of attribute attempt.



340
341
342
# File 'lib/sportradar/api/football/play_statistics.rb', line 340

def attempt
  @attempt
end

#endzoneObject

Returns the value of attribute endzone.



340
341
342
# File 'lib/sportradar/api/football/play_statistics.rb', line 340

def endzone
  @endzone
end

#gross_yardsObject

Returns the value of attribute gross_yards.



340
341
342
# File 'lib/sportradar/api/football/play_statistics.rb', line 340

def gross_yards
  @gross_yards
end

#inside_20Object

Returns the value of attribute inside_20.



340
341
342
# File 'lib/sportradar/api/football/play_statistics.rb', line 340

def inside_20
  @inside_20
end

#nullifiedObject

Returns the value of attribute nullified.



340
341
342
# File 'lib/sportradar/api/football/play_statistics.rb', line 340

def nullified
  @nullified
end

#playerObject

Returns the value of attribute player.



340
341
342
# File 'lib/sportradar/api/football/play_statistics.rb', line 340

def player
  @player
end

#teamObject

Returns the value of attribute team.



340
341
342
# File 'lib/sportradar/api/football/play_statistics.rb', line 340

def team
  @team
end

#touchbackObject

Returns the value of attribute touchback.



340
341
342
# File 'lib/sportradar/api/football/play_statistics.rb', line 340

def touchback
  @touchback
end

#yardsObject

Returns the value of attribute yards.



340
341
342
# File 'lib/sportradar/api/football/play_statistics.rb', line 340

def yards
  @yards
end

Instance Method Details

#nullified?Boolean

Returns:

  • (Boolean)


355
356
357
# File 'lib/sportradar/api/football/play_statistics.rb', line 355

def nullified?
  @nullified.to_s == 'true'
end