Class: Sportradar::Api::Football::StatPack::Passing
- Inherits:
-
Sportradar::Api::Football::StatPack
- Object
- Data
- Sportradar::Api::Football::StatPack
- Sportradar::Api::Football::StatPack::Passing
- Defined in:
- lib/sportradar/api/football/stat_pack/passing.rb
Instance Attribute Summary collapse
-
#air_yards ⇒ Object
Returns the value of attribute air_yards.
-
#attempts ⇒ Object
Returns the value of attribute attempts.
-
#avg_yards ⇒ Object
Returns the value of attribute avg_yards.
-
#cmp_pct ⇒ Object
Returns the value of attribute cmp_pct.
-
#completions ⇒ Object
Returns the value of attribute completions.
-
#interceptions ⇒ Object
Returns the value of attribute interceptions.
-
#longest ⇒ Object
Returns the value of attribute longest.
-
#longest_touchdown ⇒ Object
Returns the value of attribute longest_touchdown.
-
#net_yards ⇒ Object
Returns the value of attribute net_yards.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#redzone_attempts ⇒ Object
Returns the value of attribute redzone_attempts.
-
#sack_yards ⇒ Object
Returns the value of attribute sack_yards.
-
#sacks ⇒ Object
Returns the value of attribute sacks.
-
#touchdowns ⇒ Object
Returns the value of attribute touchdowns.
-
#yards ⇒ Object
Returns the value of attribute yards.
Attributes inherited from Sportradar::Api::Football::StatPack
#id, #name, #player, #players, #position, #response
Instance Method Summary collapse
Methods inherited from Sportradar::Api::Football::StatPack
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
This class inherits a constructor from Sportradar::Api::Football::StatPack
Instance Attribute Details
#air_yards ⇒ Object
Returns the value of attribute air_yards.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def air_yards @air_yards end |
#attempts ⇒ Object
Returns the value of attribute attempts.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def attempts @attempts end |
#avg_yards ⇒ Object
Returns the value of attribute avg_yards.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def avg_yards @avg_yards end |
#cmp_pct ⇒ Object
Returns the value of attribute cmp_pct.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def cmp_pct @cmp_pct end |
#completions ⇒ Object
Returns the value of attribute completions.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def completions @completions end |
#interceptions ⇒ Object
Returns the value of attribute interceptions.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def interceptions @interceptions end |
#longest ⇒ Object
Returns the value of attribute longest.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def longest @longest end |
#longest_touchdown ⇒ Object
Returns the value of attribute longest_touchdown.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def longest_touchdown @longest_touchdown end |
#net_yards ⇒ Object
Returns the value of attribute net_yards.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def net_yards @net_yards end |
#rating ⇒ Object
Returns the value of attribute rating.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def @rating end |
#redzone_attempts ⇒ Object
Returns the value of attribute redzone_attempts.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def redzone_attempts @redzone_attempts end |
#sack_yards ⇒ Object
Returns the value of attribute sack_yards.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def sack_yards @sack_yards end |
#sacks ⇒ Object
Returns the value of attribute sacks.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def sacks @sacks end |
#touchdowns ⇒ Object
Returns the value of attribute touchdowns.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def touchdowns @touchdowns end |
#yards ⇒ Object
Returns the value of attribute yards.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 4 def yards @yards end |
Instance Method Details
#set_stats ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/sportradar/api/football/stat_pack/passing.rb', line 6 def set_stats @attempts = response["attempts"] || response['att'] @completions = response["completions"] || response['cmp'] @cmp_pct = response["cmp_pct"] # 'yards' is air yards, which does not include sack yardage. air_yards is for college, net_yards for NFL @yards = response["yards"] || response['yds'] @avg_yards = response["avg_yards"] || response['avg'] @sacks = response["sacks"] || response['sk'] @sack_yards = response["sack_yards"] || response['sk_yds'] @touchdowns = response["touchdowns"] || response['td'] @longest = response["longest"] || response['lg'] @interceptions = response["interceptions"] || response['int'] @rating = response["rating"] @longest_touchdown = response["longest_touchdown"] @air_yards = response["air_yards"] # passing net_yards is the correct measure for team stats, as it includes sack yardage @net_yards = response["net_yards"] @redzone_attempts = response["redzone_attempts"] || response['rz_att'] end |