Class: Sportradar::Api::Football::PlayReturnStatistics

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

Returns a new instance of PlayReturnStatistics.



375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/sportradar/api/football/play_statistics.rb', line 375

def initialize(data)
  @response = data
  @category      = data['category']
  @downed        = data['downed']
  @faircatch     = data['faircatch']      || data['fc']
  @out_of_bounds = data['out_of_bounds']
  @return        = data['return']         || data['returns']
  @touchback     = data['touchback']      || data['tb']
  @touchdown     = data['touchdown']      || data['td']
  @yards         = data['yards']          || data['yds']
  @team          = OpenStruct.new(data['team']) if data['team']
  @player        = OpenStruct.new(data['player']) if data['player']
  @nullified     = data['nullified']
end

Instance Attribute Details

#categoryObject

Returns the value of attribute category.



374
375
376
# File 'lib/sportradar/api/football/play_statistics.rb', line 374

def category
  @category
end

#downedObject

Returns the value of attribute downed.



374
375
376
# File 'lib/sportradar/api/football/play_statistics.rb', line 374

def downed
  @downed
end

#faircatchObject

Returns the value of attribute faircatch.



374
375
376
# File 'lib/sportradar/api/football/play_statistics.rb', line 374

def faircatch
  @faircatch
end

#nullifiedObject

Returns the value of attribute nullified.



374
375
376
# File 'lib/sportradar/api/football/play_statistics.rb', line 374

def nullified
  @nullified
end

#out_of_boundsObject

Returns the value of attribute out_of_bounds.



374
375
376
# File 'lib/sportradar/api/football/play_statistics.rb', line 374

def out_of_bounds
  @out_of_bounds
end

#playerObject

Returns the value of attribute player.



374
375
376
# File 'lib/sportradar/api/football/play_statistics.rb', line 374

def player
  @player
end

#returnObject

Returns the value of attribute return.



374
375
376
# File 'lib/sportradar/api/football/play_statistics.rb', line 374

def return
  @return
end

#teamObject

Returns the value of attribute team.



374
375
376
# File 'lib/sportradar/api/football/play_statistics.rb', line 374

def team
  @team
end

#touchbackObject

Returns the value of attribute touchback.



374
375
376
# File 'lib/sportradar/api/football/play_statistics.rb', line 374

def touchback
  @touchback
end

#touchdownObject

Returns the value of attribute touchdown.



374
375
376
# File 'lib/sportradar/api/football/play_statistics.rb', line 374

def touchdown
  @touchdown
end

#yardsObject

Returns the value of attribute yards.



374
375
376
# File 'lib/sportradar/api/football/play_statistics.rb', line 374

def yards
  @yards
end

Instance Method Details

#nullified?Boolean

Returns:

  • (Boolean)


390
391
392
# File 'lib/sportradar/api/football/play_statistics.rb', line 390

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