Class: Sportradar::Api::Football::PlayPenaltyStatistics
- Defined in:
- lib/sportradar/api/football/play_statistics.rb
Instance Attribute Summary collapse
-
#first_down ⇒ Object
Returns the value of attribute first_down.
-
#nullified ⇒ Object
Returns the value of attribute nullified.
-
#penalty ⇒ Object
Returns the value of attribute penalty.
-
#player ⇒ Object
Returns the value of attribute player.
-
#team ⇒ Object
Returns the value of attribute team.
-
#yards ⇒ Object
Returns the value of attribute yards.
Instance Method Summary collapse
-
#initialize(data) ⇒ PlayPenaltyStatistics
constructor
A new instance of PlayPenaltyStatistics.
- #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) ⇒ PlayPenaltyStatistics
Returns a new instance of PlayPenaltyStatistics.
234 235 236 237 238 239 240 241 242 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 234 def initialize(data) @response = data @penalty = data['penalty'] || data['abbr'] # unsure about abbr here @yards = data['yards'] || data['yds'] @first_down = data['fd'] @team = OpenStruct.new(data['team']) if data['team'] @player = OpenStruct.new(data['player']) if data['player'] @nullified = data['nullified'] end |
Instance Attribute Details
#first_down ⇒ Object
Returns the value of attribute first_down.
233 234 235 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 233 def first_down @first_down end |
#nullified ⇒ Object
Returns the value of attribute nullified.
233 234 235 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 233 def nullified @nullified end |
#penalty ⇒ Object
Returns the value of attribute penalty.
233 234 235 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 233 def penalty @penalty end |
#player ⇒ Object
Returns the value of attribute player.
233 234 235 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 233 def player @player end |
#team ⇒ Object
Returns the value of attribute team.
233 234 235 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 233 def team @team end |
#yards ⇒ Object
Returns the value of attribute yards.
233 234 235 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 233 def yards @yards end |
Instance Method Details
#nullified? ⇒ Boolean
244 245 246 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 244 def nullified? @nullified.to_s == 'true' end |