Class: Sportradar::Api::Football::PlayPuntStatistics
- Defined in:
- lib/sportradar/api/football/play_statistics.rb
Instance Attribute Summary collapse
-
#attempt ⇒ Object
Returns the value of attribute attempt.
-
#downed ⇒ Object
Returns the value of attribute downed.
-
#faircatch ⇒ Object
Returns the value of attribute faircatch.
-
#inside_20 ⇒ Object
Returns the value of attribute inside_20.
-
#nullified ⇒ Object
Returns the value of attribute nullified.
-
#out_of_bounds ⇒ Object
Returns the value of attribute out_of_bounds.
-
#player ⇒ Object
Returns the value of attribute player.
-
#team ⇒ Object
Returns the value of attribute team.
-
#touchback ⇒ Object
Returns the value of attribute touchback.
-
#yards ⇒ Object
Returns the value of attribute yards.
Instance Method Summary collapse
-
#initialize(data) ⇒ PlayPuntStatistics
constructor
A new instance of PlayPuntStatistics.
- #nullified? ⇒ 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) ⇒ PlayPuntStatistics
Returns a new instance of PlayPuntStatistics.
251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 251 def initialize(data) @response = data data = data.first if data.is_a?(Array) @attempt = data['attempt'] || data['punts'] @downed = data['downed'] @inside_20 = data['inside_20'] || data['in20'] @out_of_bounds = data['out_of_bounds'] @touchback = data['touchback'] || data['tb'] @yards = data['yards'] || data['yds'] @blocked = data['blk'] @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.
250 251 252 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 250 def attempt @attempt end |
#downed ⇒ Object
Returns the value of attribute downed.
250 251 252 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 250 def downed @downed end |
#faircatch ⇒ Object
Returns the value of attribute faircatch.
250 251 252 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 250 def faircatch @faircatch end |
#inside_20 ⇒ Object
Returns the value of attribute inside_20.
250 251 252 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 250 def inside_20 @inside_20 end |
#nullified ⇒ Object
Returns the value of attribute nullified.
250 251 252 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 250 def nullified @nullified end |
#out_of_bounds ⇒ Object
Returns the value of attribute out_of_bounds.
250 251 252 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 250 def out_of_bounds @out_of_bounds end |
#player ⇒ Object
Returns the value of attribute player.
250 251 252 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 250 def player @player end |
#team ⇒ Object
Returns the value of attribute team.
250 251 252 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 250 def team @team end |
#touchback ⇒ Object
Returns the value of attribute touchback.
250 251 252 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 250 def touchback @touchback end |
#yards ⇒ Object
Returns the value of attribute yards.
250 251 252 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 250 def yards @yards end |
Instance Method Details
#nullified? ⇒ Boolean
266 267 268 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 266 def nullified? @nullified.to_s == 'true' end |