Class: Sportradar::Api::Football::PlayPassingStatistics

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

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

#attemptObject

Returns the value of attribute attempt.



204
205
206
# File 'lib/sportradar/api/football/play_statistics.rb', line 204

def attempt
  @attempt
end

#completeObject

Returns the value of attribute complete.



204
205
206
# File 'lib/sportradar/api/football/play_statistics.rb', line 204

def complete
  @complete
end

#firstdownObject

Returns the value of attribute firstdown.



204
205
206
# File 'lib/sportradar/api/football/play_statistics.rb', line 204

def firstdown
  @firstdown
end

#goaltogoObject

Returns the value of attribute goaltogo.



204
205
206
# File 'lib/sportradar/api/football/play_statistics.rb', line 204

def goaltogo
  @goaltogo
end

#inside_20Object

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

#interceptionObject

Returns the value of attribute interception.



204
205
206
# File 'lib/sportradar/api/football/play_statistics.rb', line 204

def interception
  @interception
end

#nullifiedObject

Returns the value of attribute nullified.



204
205
206
# File 'lib/sportradar/api/football/play_statistics.rb', line 204

def nullified
  @nullified
end

#playerObject

Returns the value of attribute player.



204
205
206
# File 'lib/sportradar/api/football/play_statistics.rb', line 204

def player
  @player
end

#sackObject

Returns the value of attribute sack.



204
205
206
# File 'lib/sportradar/api/football/play_statistics.rb', line 204

def sack
  @sack
end

#sack_yardsObject

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

#teamObject

Returns the value of attribute team.



204
205
206
# File 'lib/sportradar/api/football/play_statistics.rb', line 204

def team
  @team
end

#touchdownObject

Returns the value of attribute touchdown.



204
205
206
# File 'lib/sportradar/api/football/play_statistics.rb', line 204

def touchdown
  @touchdown
end

#yardsObject

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

Returns:

  • (Boolean)


227
228
229
# File 'lib/sportradar/api/football/play_statistics.rb', line 227

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

#touchdown?Boolean

Returns:

  • (Boolean)


223
224
225
# File 'lib/sportradar/api/football/play_statistics.rb', line 223

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