Class: Sportradar::Api::Football::PlayRushStatistics
- Defined in:
- lib/sportradar/api/football/play_statistics.rb
Instance Attribute Summary collapse
-
#attempt ⇒ Object
Returns the value of attribute attempt.
-
#firstdown ⇒ Object
Returns the value of attribute firstdown.
-
#goal_to_go ⇒ Object
Returns the value of attribute goal_to_go.
-
#inside_20 ⇒ Object
Returns the value of attribute inside_20.
-
#nullified ⇒ Object
Returns the value of attribute nullified.
-
#player ⇒ Object
Returns the value of attribute player.
-
#team ⇒ Object
Returns the value of attribute team.
-
#tlost ⇒ Object
Returns the value of attribute tlost.
-
#tlost_yards ⇒ Object
Returns the value of attribute tlost_yards.
-
#touchdown ⇒ Object
Returns the value of attribute touchdown.
-
#yards ⇒ Object
Returns the value of attribute yards.
Instance Method Summary collapse
-
#initialize(data) ⇒ PlayRushStatistics
constructor
A new instance of PlayRushStatistics.
- #nullified? ⇒ Boolean
- #touchdown? ⇒ Boolean
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
#attempt ⇒ Object
Returns the value of attribute attempt.
312 313 314 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 312 def attempt @attempt end |
#firstdown ⇒ Object
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_go ⇒ Object
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_20 ⇒ Object
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 |
#nullified ⇒ Object
Returns the value of attribute nullified.
312 313 314 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 312 def nullified @nullified end |
#player ⇒ Object
Returns the value of attribute player.
312 313 314 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 312 def player @player end |
#team ⇒ Object
Returns the value of attribute team.
312 313 314 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 312 def team @team end |
#tlost ⇒ Object
Returns the value of attribute tlost.
312 313 314 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 312 def tlost @tlost end |
#tlost_yards ⇒ Object
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 |
#touchdown ⇒ Object
Returns the value of attribute touchdown.
312 313 314 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 312 def touchdown @touchdown end |
#yards ⇒ Object
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
333 334 335 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 333 def nullified? @nullified.to_s == 'true' end |
#touchdown? ⇒ Boolean
329 330 331 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 329 def touchdown? @touchdown == 1 && !nullified? end |