Sha256: 7ad44aa1b99480f7c658dce599fcecbf3175596f98b563c1081998e5de24bc2f

Contents?: true

Size: 1.19 KB

Versions: 128

Compression:

Stored size: 1.19 KB

Contents

module Sportradar
  module Api
    class Football::StatPack::Receiving < Football::StatPack
      attr_accessor :avg_yards, :yards, :touchdowns, :longest, :longest_touchdown, :targets, :receptions, :yards_after_catch, :redzone_targets, :air_yards

      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
    end

  end
end
# ncaafb = {"tar"=>54, "rec"=>38, "yds"=>441, "yac"=>441, "fd"=>19, "avg"=>11.605, "td"=>4, "lg"=>34, "rz_tar"=>8, "fum"=>0, "yds_10_pls"=>9, "yds_20_pls"=>3, "yds_30_pls"=>3, "yds_40_pls"=>0, "yds_50_pls"=>0}

Version data entries

128 entries across 128 versions & 1 rubygems

Version Path
sportradar-api-0.11.28 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.27 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.26 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.25 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.24 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.23 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.22 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.21 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.20 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.19 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.18 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.17 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.16 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.15 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.14 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.13 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.12 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.11 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.10 lib/sportradar/api/football/stat_pack/receiving.rb
sportradar-api-0.11.9 lib/sportradar/api/football/stat_pack/receiving.rb