Class: Sportradar::Api::Football::PlayFieldGoalStatistics
- 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.
-
#blocked ⇒ Object
Returns the value of attribute blocked.
-
#missed ⇒ Object
Returns the value of attribute missed.
-
#nullified ⇒ Object
Returns the value of attribute nullified.
-
#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) ⇒ PlayFieldGoalStatistics
constructor
A new instance of PlayFieldGoalStatistics.
- #made? ⇒ Boolean
- #missed? ⇒ Boolean
- #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) ⇒ PlayFieldGoalStatistics
Returns a new instance of PlayFieldGoalStatistics.
164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 164 def initialize(data) @response = data @attempt = data['attempt'] || data['att'] @att_yards = data['att_yards'] @blocked = data['blocked'] || data['blk'] @missed = data['missed'] @yards = data['yards'] || data['yds'] @nullified = data['nullified'] @team = OpenStruct.new(data['team']) if data['team'] @player = OpenStruct.new(data['player']) if data['player'] end |
Instance Attribute Details
#att_yards ⇒ Object
Returns the value of attribute att_yards.
163 164 165 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 163 def att_yards @att_yards end |
#attempt ⇒ Object
Returns the value of attribute attempt.
163 164 165 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 163 def attempt @attempt end |
#blocked ⇒ Object
Returns the value of attribute blocked.
163 164 165 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 163 def blocked @blocked end |
#missed ⇒ Object
Returns the value of attribute missed.
163 164 165 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 163 def missed @missed end |
#nullified ⇒ Object
Returns the value of attribute nullified.
163 164 165 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 163 def nullified @nullified end |
#player ⇒ Object
Returns the value of attribute player.
163 164 165 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 163 def player @player end |
#team ⇒ Object
Returns the value of attribute team.
163 164 165 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 163 def team @team end |
#yards ⇒ Object
Returns the value of attribute yards.
163 164 165 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 163 def yards @yards end |
Instance Method Details
#made? ⇒ Boolean
176 177 178 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 176 def made? !missed? && !nullified? end |
#missed? ⇒ Boolean
180 181 182 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 180 def missed? @missed == 1 || @blocked == 1 end |
#nullified? ⇒ Boolean
184 185 186 |
# File 'lib/sportradar/api/football/play_statistics.rb', line 184 def nullified? @nullified.to_s == 'true' end |