Class: Sportradar::Api::Football::StatPack::Receiving
- Inherits:
-
Sportradar::Api::Football::StatPack
- Object
- Data
- Sportradar::Api::Football::StatPack
- Sportradar::Api::Football::StatPack::Receiving
- Defined in:
- lib/sportradar/api/football/stat_pack/receiving.rb
Instance Attribute Summary collapse
-
#air_yards ⇒ Object
Returns the value of attribute air_yards.
-
#avg_yards ⇒ Object
Returns the value of attribute avg_yards.
-
#longest ⇒ Object
Returns the value of attribute longest.
-
#longest_touchdown ⇒ Object
Returns the value of attribute longest_touchdown.
-
#receptions ⇒ Object
Returns the value of attribute receptions.
-
#redzone_targets ⇒ Object
Returns the value of attribute redzone_targets.
-
#targets ⇒ Object
Returns the value of attribute targets.
-
#touchdowns ⇒ Object
Returns the value of attribute touchdowns.
-
#yards ⇒ Object
Returns the value of attribute yards.
-
#yards_after_catch ⇒ Object
Returns the value of attribute yards_after_catch.
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/receiving.rb', line 4 def air_yards @air_yards end |
#avg_yards ⇒ Object
Returns the value of attribute avg_yards.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/receiving.rb', line 4 def avg_yards @avg_yards end |
#longest ⇒ Object
Returns the value of attribute longest.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/receiving.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/receiving.rb', line 4 def longest_touchdown @longest_touchdown end |
#receptions ⇒ Object
Returns the value of attribute receptions.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/receiving.rb', line 4 def receptions @receptions end |
#redzone_targets ⇒ Object
Returns the value of attribute redzone_targets.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/receiving.rb', line 4 def redzone_targets @redzone_targets end |
#targets ⇒ Object
Returns the value of attribute targets.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/receiving.rb', line 4 def targets @targets end |
#touchdowns ⇒ Object
Returns the value of attribute touchdowns.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/receiving.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/receiving.rb', line 4 def yards @yards end |
#yards_after_catch ⇒ Object
Returns the value of attribute yards_after_catch.
4 5 6 |
# File 'lib/sportradar/api/football/stat_pack/receiving.rb', line 4 def yards_after_catch @yards_after_catch end |
Instance Method Details
#set_stats ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/sportradar/api/football/stat_pack/receiving.rb', line 6 def set_stats @yards = response["yards"] || response['yds'] @touchdowns = response["touchdowns"] || response['td'] @longest = response["longest"] || response['lg'] @longest_touchdown = response["longest_touchdown"] @targets = response["targets"] || response['tar'] @receptions = response["receptions"] || response['rec'] @yards_after_catch = response["yards_after_catch"] || response['yac'] @redzone_targets = response["redzone_targets"] || response['rz_tar'] @air_yards = response["air_yards"] # unknown ncaafb @avg_yards = response["avg_yards"] || (@yards.to_f / @receptions.to_i) end |