Sha256: 6b3a43d9089d550b333e619c3014bced52e2a05fca230071c52a2d5b10691ef6

Contents?: true

Size: 1.29 KB

Versions: 5

Compression:

Stored size: 1.29 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"]
        @completions       = response["completions"]
        @cmp_pct           = response["cmp_pct"]
        # @yards             = response["yards"]
        @avg_yards         = response["avg_yards"]
        @sacks             = response["sacks"]
        @sack_yards        = response["sack_yards"]
        @touchdowns        = response["touchdowns"]
        @longest           = response["longest"]
        @interceptions     = response["interceptions"]
        @rating            = response["rating"]
        @longest_touchdown = response["longest_touchdown"]
        @air_yards         = response["air_yards"]
        @net_yards         = response["net_yards"] # passing net_yards is the correct measure for team stats, as it includes sack yardage
        @yards             = response["net_yards"] # should look further into this, make sure this isn't a bad idea
        @redzone_attempts  = response["redzone_attempts"]
      end
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sportradar-api-0.1.38 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.1.37 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.1.36 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.1.35 lib/sportradar/api/football/stat_pack/passing.rb
sportradar-api-0.1.34 lib/sportradar/api/football/stat_pack/passing.rb