Sha256: 6b1625cfda7e9420f6ce29804b50a45b11892bcd61619b21105e80e162998554

Contents?: true

Size: 1.58 KB

Versions: 7

Compression:

Stored size: 1.58 KB

Contents

module Sportradar
  module Api
    class Football::StatPack::ExtraPoints < Football::StatPack
      attr_accessor :attempts, :made, :blocked, :pass_attempts, :pass_successes, :rush_attempts, :rush_successes, :defense_attempts, :defense_successes, :turnover_successes

      def set_stats
        kick_data = response['kicks'] || response
        @attempts = kick_response["attempts"]
        @made     = kick_response["made"]
        @blocked  = kick_response["blocked"]
        if response['conversions']
          @pass_attempts      = response["pass_attempts"]
          @pass_successes     = response["pass_successes"]
          @rush_attempts      = response["rush_attempts"]
          @rush_successes     = response["rush_successes"]
          @defense_attempts   = response["defense_attempts"]
          @defense_successes  = response["defense_successes"]
          @turnover_successes = response["turnover_successes"]
        end
      end

    end
  end
end

# # sample response
# extra_points = 
#   {"kicks"=>
#     {"player"=>
#       [
#        {"name"=>"Aldrick Rosas",
#         "jersey"=>"03",
#         "reference"=>"00-0032870",
#         "id"=>"8fb2ca06-3d13-4552-98e0-7b913b4ab5b9",
#         "position"=>"K",
#         "attempts"=>"1",
#         "made"=>"1",
#         "blocked"=>"0"}],
#      "attempts"=>"3",
#      "blocked"=>"0",
#      "made"=>"3"},
#   "conversions"=> {
#     "pass_attempts"=>"0",
#     "pass_successes"=>"0",
#     "rush_attempts"=>"0",
#     "rush_successes"=>"0",
#     "defense_attempts"=>"0",
#     "defense_successes"=>"0",
#     "turnover_successes"=>"0"
#     }
#   }

Version data entries

7 entries across 7 versions & 1 rubygems

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