Class: Sportradar::Api::Football::PlayRushStatistics

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

Returns a new instance of PlayRushStatistics.



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/sportradar/api/football/play_statistics.rb', line 313

def initialize(data)
  @response = data
  @attempt     = data['attempt']      || data['att']
  @firstdown   = data['firstdown']    || data['fd']
  @goal_to_go  = data['goal_to_go']
  @inside_20   = data['inside_20']    || data['rz_att']
  @tlost       = data['tlost']
  @tlost_yards = data['tlost_yards']
  @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

#attemptObject

Returns the value of attribute attempt.



312
313
314
# File 'lib/sportradar/api/football/play_statistics.rb', line 312

def attempt
  @attempt
end

#firstdownObject

Returns the value of attribute firstdown.



312
313
314
# File 'lib/sportradar/api/football/play_statistics.rb', line 312

def firstdown
  @firstdown
end

#goal_to_goObject

Returns the value of attribute goal_to_go.



312
313
314
# File 'lib/sportradar/api/football/play_statistics.rb', line 312

def goal_to_go
  @goal_to_go
end

#inside_20Object

Returns the value of attribute inside_20.



312
313
314
# File 'lib/sportradar/api/football/play_statistics.rb', line 312

def inside_20
  @inside_20
end

#nullifiedObject

Returns the value of attribute nullified.



312
313
314
# File 'lib/sportradar/api/football/play_statistics.rb', line 312

def nullified
  @nullified
end

#playerObject

Returns the value of attribute player.



312
313
314
# File 'lib/sportradar/api/football/play_statistics.rb', line 312

def player
  @player
end

#teamObject

Returns the value of attribute team.



312
313
314
# File 'lib/sportradar/api/football/play_statistics.rb', line 312

def team
  @team
end

#tlostObject

Returns the value of attribute tlost.



312
313
314
# File 'lib/sportradar/api/football/play_statistics.rb', line 312

def tlost
  @tlost
end

#tlost_yardsObject

Returns the value of attribute tlost_yards.



312
313
314
# File 'lib/sportradar/api/football/play_statistics.rb', line 312

def tlost_yards
  @tlost_yards
end

#touchdownObject

Returns the value of attribute touchdown.



312
313
314
# File 'lib/sportradar/api/football/play_statistics.rb', line 312

def touchdown
  @touchdown
end

#yardsObject

Returns the value of attribute yards.



312
313
314
# File 'lib/sportradar/api/football/play_statistics.rb', line 312

def yards
  @yards
end

Instance Method Details

#nullified?Boolean

Returns:

  • (Boolean)


333
334
335
# File 'lib/sportradar/api/football/play_statistics.rb', line 333

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

#touchdown?Boolean

Returns:

  • (Boolean)


329
330
331
# File 'lib/sportradar/api/football/play_statistics.rb', line 329

def touchdown?
  @touchdown == 1 && !nullified?
end