Sha256: 87ae611f5df868afd2c81258ac9b714c0d1246bf8a3937866d07c6b714632117

Contents?: true

Size: 471 Bytes

Versions: 4

Compression:

Stored size: 471 Bytes

Contents

module Sportradar
  module Api
    module Football
      class StatsShim
        attr_reader :game

        def initialize(game)
          @game = game
        end

        def dig(player_id, category, stat)
          game.team_stats.each_value do |stats|
            player = stats.public_send(category).for_player(player_id)
            if player
              return player.send(stat)
            end
          end
          0
        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sportradar-api-0.19.5 lib/sportradar/api/football/stats_shim.rb
sportradar-api-0.19.4 lib/sportradar/api/football/stats_shim.rb
sportradar-api-0.19.3 lib/sportradar/api/football/stats_shim.rb
sportradar-api-0.19.2 lib/sportradar/api/football/stats_shim.rb