Sha256: e2e58cb0506b8c1c1f1280cc8b1a4919ca608c5117a6e6dee46ac72b33c0a12d

Contents?: true

Size: 473 Bytes

Versions: 6

Compression:

Stored size: 473 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
          nil
        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sportradar-api-0.20.2 lib/sportradar/api/football/stats_shim.rb
sportradar-api-0.20.1 lib/sportradar/api/football/stats_shim.rb
sportradar-api-0.20.0 lib/sportradar/api/football/stats_shim.rb
sportradar-api-0.20.0.pre2 lib/sportradar/api/football/stats_shim.rb
sportradar-api-0.20.0.pre lib/sportradar/api/football/stats_shim.rb
sportradar-api-0.19.6 lib/sportradar/api/football/stats_shim.rb