Class: Sportradar::Api::Football::PlayFumbleStatistics

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

Returns a new instance of PlayFumbleStatistics.



295
296
297
298
299
300
301
302
303
304
305
# File 'lib/sportradar/api/football/play_statistics.rb', line 295

def initialize(data)
  @response = data
  @oob            = data['oob']
  @lost           = data['lost']
  @own_rec        = data['own_rec']
  @own_rec_yards  = data['own_rec_yards']
  @forced         = data['forced']

  @team        = OpenStruct.new(data['team'])   if data['team']
  @player      = OpenStruct.new(data['player']) if data['player']
end

Instance Attribute Details

#forcedObject (readonly)

Returns the value of attribute forced.



294
295
296
# File 'lib/sportradar/api/football/play_statistics.rb', line 294

def forced
  @forced
end

#own_recObject (readonly)

Returns the value of attribute own_rec.



294
295
296
# File 'lib/sportradar/api/football/play_statistics.rb', line 294

def own_rec
  @own_rec
end

#own_rec_yardsObject (readonly)

Returns the value of attribute own_rec_yards.



294
295
296
# File 'lib/sportradar/api/football/play_statistics.rb', line 294

def own_rec_yards
  @own_rec_yards
end

#playerObject (readonly)

Returns the value of attribute player.



294
295
296
# File 'lib/sportradar/api/football/play_statistics.rb', line 294

def player
  @player
end

#teamObject (readonly)

Returns the value of attribute team.



294
295
296
# File 'lib/sportradar/api/football/play_statistics.rb', line 294

def team
  @team
end

Instance Method Details

#lost?Boolean

Returns:

  • (Boolean)


306
307
308
# File 'lib/sportradar/api/football/play_statistics.rb', line 306

def lost?
  @lost == 1 || @own_rec == 0
end