Class: Sportradar::Api::Football::StatPack::Kickoffs

Inherits:
Sportradar::Api::Football::StatPack show all
Defined in:
lib/sportradar/api/football/stat_pack/kickoffs.rb

Instance Attribute Summary collapse

Attributes inherited from Sportradar::Api::Football::StatPack

#id, #name, #player, #players, #position, #response

Instance Method Summary collapse

Methods inherited from Sportradar::Api::Football::StatPack

#for_player, #initialize

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

#averageObject

Returns the value of attribute average.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/kickoffs.rb', line 4

def average
  @average
end

#endzoneObject

Returns the value of attribute endzone.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/kickoffs.rb', line 4

def endzone
  @endzone
end

#inside_20Object

Returns the value of attribute inside_20.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/kickoffs.rb', line 4

def inside_20
  @inside_20
end

#kickoffsObject

Returns the value of attribute kickoffs.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/kickoffs.rb', line 4

def kickoffs
  @kickoffs
end

#out_of_boundsObject

Returns the value of attribute out_of_bounds.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/kickoffs.rb', line 4

def out_of_bounds
  @out_of_bounds
end

#return_yardsObject

Returns the value of attribute return_yards.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/kickoffs.rb', line 4

def return_yards
  @return_yards
end

#touchbacksObject

Returns the value of attribute touchbacks.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/kickoffs.rb', line 4

def touchbacks
  @touchbacks
end

#yardsObject

Returns the value of attribute yards.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/kickoffs.rb', line 4

def yards
  @yards
end

Instance Method Details

#set_statsObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/sportradar/api/football/stat_pack/kickoffs.rb', line 6

def set_stats
  @kickoffs      = response["kickoffs"] || response['kicks'] || response['number']
  @endzone       = response["endzone"]
  @inside_20     = response["inside_20"] || response['in20']
  @return_yards  = response["return_yards"] || response['ret_yds']
  @touchbacks    = response["touchbacks"] || response['tb']
  @yards         = response["yards"] || response['yds']
  @average       = response['avg'] || (@yards.to_f / @kickoffs.to_i)
  @out_of_bounds = response["out_of_bounds"] # unknown ncaafb
end