Class: Sportradar::Api::Football::PlayPassingStatistics
- Defined in:
- lib/sportradar/api/football/play_statistics.rb
Instance Attribute Summary collapse
-
#att_yards ⇒ Object
Returns the value of attribute att_yards.
-
#attempt ⇒ Object
Returns the value of attribute attempt.
-
#complete ⇒ Object
Returns the value of attribute complete.
-
#firstdown ⇒ Object
Returns the value of attribute firstdown.
-
#goaltogo ⇒ Object
Returns the value of attribute goaltogo.
-
#inside_20 ⇒ Object
Returns the value of attribute inside_20.
-
#interception ⇒ Object
Returns the value of attribute interception.
-
#nullified ⇒ Object
Returns the value of attribute nullified.
-
#player ⇒ Object
Returns the value of attribute player.
-
#sack ⇒ Object
Returns the value of attribute sack.
-
#sack_yards ⇒ Object
Returns the value of attribute sack_yards.
-
#team ⇒ Object
Returns the value of attribute team.
-
#touchdown ⇒ Object
Returns the value of attribute touchdown.
-
#yards ⇒ Object
Returns the value of attribute yards.
Instance Method Summary collapse
-
#initialize(data) ⇒ PlayPassingStatistics
constructor
A new instance of PlayPassingStatistics.
- #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) ⇒ PlayPassingStatistics
Returns a new instance of PlayPassingStatistics.
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 205 def initialize(data) @response = data @attempt = data['attempt'] || data['att'] @att_yards = data['att_yards'] @complete = data['complete'] || data['cmp'] @firstdown = data['firstdown'] || data['fd'] @goaltogo = data['goaltogo'] @inside_20 = data['inside_20'] || data['rz_att'] @interception = data['interception'] || data['int'] @sack = data['sack'] || data['sk'] @sack_yards = data['sack_yards'] || data['sk_yds'] @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
#att_yards ⇒ Object
Returns the value of attribute att_yards.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def att_yards @att_yards end |
#attempt ⇒ Object
Returns the value of attribute attempt.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def attempt @attempt end |
#complete ⇒ Object
Returns the value of attribute complete.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def complete @complete end |
#firstdown ⇒ Object
Returns the value of attribute firstdown.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def firstdown @firstdown end |
#goaltogo ⇒ Object
Returns the value of attribute goaltogo.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def goaltogo @goaltogo end |
#inside_20 ⇒ Object
Returns the value of attribute inside_20.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def inside_20 @inside_20 end |
#interception ⇒ Object
Returns the value of attribute interception.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def interception @interception end |
#nullified ⇒ Object
Returns the value of attribute nullified.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def nullified @nullified end |
#player ⇒ Object
Returns the value of attribute player.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def player @player end |
#sack ⇒ Object
Returns the value of attribute sack.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def sack @sack end |
#sack_yards ⇒ Object
Returns the value of attribute sack_yards.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def sack_yards @sack_yards end |
#team ⇒ Object
Returns the value of attribute team.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def team @team end |
#touchdown ⇒ Object
Returns the value of attribute touchdown.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def touchdown @touchdown end |
#yards ⇒ Object
Returns the value of attribute yards.
204 205 206 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 204 def yards @yards end |
Instance Method Details
#nullified? ⇒ Boolean
227 228 229 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 227 def nullified? @nullified.to_s == 'true' end |
#touchdown? ⇒ Boolean
223 224 225 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 223 def touchdown? @touchdown == 1 && !nullified? end |