lib/sportradar/api/football/stat_pack/kickoffs.rb in sportradar-api-0.10.55 vs lib/sportradar/api/football/stat_pack/kickoffs.rb in sportradar-api-0.11.0
- old
+ new
@@ -1,18 +1,20 @@
module Sportradar
module Api
class Football::StatPack::Kickoffs < Football::StatPack
- attr_accessor :kickoffs, :endzone, :inside_20, :return_yards, :touchbacks, :yards, :out_of_bounds
+ attr_accessor :kickoffs, :endzone, :inside_20, :return_yards, :touchbacks, :yards, :out_of_bounds, :average
def set_stats
- @kickoffs = response["kickoffs"]
+ @kickoffs = response["kickoffs"] || response['kicks'] || response['number']
@endzone = response["endzone"]
- @inside_20 = response["inside_20"]
- @return_yards = response["return_yards"]
- @touchbacks = response["touchbacks"]
- @yards = response["yards"]
- @out_of_bounds = response["out_of_bounds"]
+ @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
end
end
end
+# ncaafb = {"kicks"=>10, "yds"=>606, "net_yds"=>411, "lg"=>65, "endzone"=>3, "in20"=>3, "tb"=>2, "ret"=>7, "avg"=>60.6, "net_avg"=>41.1, "ret_yds"=>195, "avg_ret"=>27.857, "in20_pct"=>30.0, "tb_pct"=>20.0}