Class: Sportradar::Api::Football::PlayPuntStatistics

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

Returns a new instance of PlayPuntStatistics.



251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/sportradar/api/football/play_statistics.rb', line 251

def initialize(data)
  @response = data
  data = data.first if data.is_a?(Array)
  @attempt        = data['attempt']   || data['punts']
  @downed         = data['downed']
  @inside_20      = data['inside_20'] || data['in20']
  @out_of_bounds  = data['out_of_bounds']
  @touchback      = data['touchback'] || data['tb']
  @yards          = data['yards']     || data['yds']
  @blocked        = data['blk']
  @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.



250
251
252
# File 'lib/sportradar/api/football/play_statistics.rb', line 250

def attempt
  @attempt
end

#downedObject

Returns the value of attribute downed.



250
251
252
# File 'lib/sportradar/api/football/play_statistics.rb', line 250

def downed
  @downed
end

#faircatchObject

Returns the value of attribute faircatch.



250
251
252
# File 'lib/sportradar/api/football/play_statistics.rb', line 250

def faircatch
  @faircatch
end

#inside_20Object

Returns the value of attribute inside_20.



250
251
252
# File 'lib/sportradar/api/football/play_statistics.rb', line 250

def inside_20
  @inside_20
end

#nullifiedObject

Returns the value of attribute nullified.



250
251
252
# File 'lib/sportradar/api/football/play_statistics.rb', line 250

def nullified
  @nullified
end

#out_of_boundsObject

Returns the value of attribute out_of_bounds.



250
251
252
# File 'lib/sportradar/api/football/play_statistics.rb', line 250

def out_of_bounds
  @out_of_bounds
end

#playerObject

Returns the value of attribute player.



250
251
252
# File 'lib/sportradar/api/football/play_statistics.rb', line 250

def player
  @player
end

#teamObject

Returns the value of attribute team.



250
251
252
# File 'lib/sportradar/api/football/play_statistics.rb', line 250

def team
  @team
end

#touchbackObject

Returns the value of attribute touchback.



250
251
252
# File 'lib/sportradar/api/football/play_statistics.rb', line 250

def touchback
  @touchback
end

#yardsObject

Returns the value of attribute yards.



250
251
252
# File 'lib/sportradar/api/football/play_statistics.rb', line 250

def yards
  @yards
end

Instance Method Details

#nullified?Boolean

Returns:

  • (Boolean)


266
267
268
# File 'lib/sportradar/api/football/play_statistics.rb', line 266

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