Sha256: 66171b0f638235d7c73dccede99fd65000591ffecb2b809e4a307b3c85672f4a

Contents?: true

Size: 1.57 KB

Versions: 112

Compression:

Stored size: 1.57 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_data["attempts"]
        @made     = kick_data["made"]
        @blocked  = kick_data["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

112 entries across 112 versions & 1 rubygems

Version Path
sportradar-api-0.10.55 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.54 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.53 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.52 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.51 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.50 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.49 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.48 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.47 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.46 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.45 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.44 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.43 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.42 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.41 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.40 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.39 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.38 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.37 lib/sportradar/api/football/stat_pack/extra_points.rb
sportradar-api-0.10.36 lib/sportradar/api/football/stat_pack/extra_points.rb