Sha256: 54285c6fb1192cdc78785b4cdc1988b2e45ce6410e50e05b0fd609f23efde785

Contents?: true

Size: 1.55 KB

Versions: 128

Compression:

Stored size: 1.55 KB

Contents

module Sportradar
  module Api
    class Football::StatPack::Passing < Football::StatPack
      attr_accessor :attempts, :completions, :cmp_pct, :yards, :avg_yards, :sacks, :sack_yards, :touchdowns, :longest, :interceptions, :rating, :longest_touchdown, :air_yards, :net_yards, :redzone_attempts

      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
    end

  end
end

Version data entries

128 entries across 128 versions & 1 rubygems

Version Path
sportradar-api-0.11.48 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.47 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.46 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.45 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.44 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.43 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.42 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.41 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.40 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.39 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.38 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.37 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.36 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.35 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.34 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.33 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.32 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.31 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.30 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.11.29 lib/sportradar/api/football/stat_pack/passing.rb