Class: Sportradar::Api::Football::PlayReceiveStatistics

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

Returns a new instance of PlayReceiveStatistics.



273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/sportradar/api/football/play_statistics.rb', line 273

def initialize(data)
  @response = data
  @firstdown         = data['firstdown']         || data['fd']
  @goaltogo          = data['goaltogo']
  @inside_20         = data['inside_20']         || data['rz_tar']
  @reception         = data['reception']         || data['rec']
  @target            = data['target']            || data['tar']
  @touchdown         = data['touchdown']         || data['td']
  @yards             = data['yards']             || data['yds']
  @yards_after_catch = data['yards_after_catch'] || data['yac']
  @team              = OpenStruct.new(data['team']) if data['team']
  @player            = OpenStruct.new(data['player']) if data['player']
  @nullified         = data['nullified']
end

Instance Attribute Details

#firstdownObject

Returns the value of attribute firstdown.



272
273
274
# File 'lib/sportradar/api/football/play_statistics.rb', line 272

def firstdown
  @firstdown
end

#goaltogoObject

Returns the value of attribute goaltogo.



272
273
274
# File 'lib/sportradar/api/football/play_statistics.rb', line 272

def goaltogo
  @goaltogo
end

#inside_20Object

Returns the value of attribute inside_20.



272
273
274
# File 'lib/sportradar/api/football/play_statistics.rb', line 272

def inside_20
  @inside_20
end

#nullifiedObject

Returns the value of attribute nullified.



272
273
274
# File 'lib/sportradar/api/football/play_statistics.rb', line 272

def nullified
  @nullified
end

#playerObject

Returns the value of attribute player.



272
273
274
# File 'lib/sportradar/api/football/play_statistics.rb', line 272

def player
  @player
end

#receptionObject

Returns the value of attribute reception.



272
273
274
# File 'lib/sportradar/api/football/play_statistics.rb', line 272

def reception
  @reception
end

#targetObject

Returns the value of attribute target.



272
273
274
# File 'lib/sportradar/api/football/play_statistics.rb', line 272

def target
  @target
end

#teamObject

Returns the value of attribute team.



272
273
274
# File 'lib/sportradar/api/football/play_statistics.rb', line 272

def team
  @team
end

#touchdownObject

Returns the value of attribute touchdown.



272
273
274
# File 'lib/sportradar/api/football/play_statistics.rb', line 272

def touchdown
  @touchdown
end

#yardsObject

Returns the value of attribute yards.



272
273
274
# File 'lib/sportradar/api/football/play_statistics.rb', line 272

def yards
  @yards
end

#yards_after_catchObject

Returns the value of attribute yards_after_catch.



272
273
274
# File 'lib/sportradar/api/football/play_statistics.rb', line 272

def yards_after_catch
  @yards_after_catch
end

Instance Method Details

#nullified?Boolean

Returns:

  • (Boolean)


288
289
290
# File 'lib/sportradar/api/football/play_statistics.rb', line 288

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