Sha256: ebeaf7c1e162193a88127b18e3a6639a6e4ca9683fd63680103b8d8351915e94

Contents?: true

Size: 297 Bytes

Versions: 12

Compression:

Stored size: 297 Bytes

Contents

module PageRankr
  module ProxyServices
    class RoundRobin
      def initialize(proxies)
        @proxies = proxies
        @index = 0
      end

      def proxy(name, site)
        @proxies[@index].tap do
          @index = (@index + 1) % @proxies.length
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
PageRankr-4.6.1 lib/page_rankr/proxy_services/round_robin.rb
PageRankr-4.6.0 lib/page_rankr/proxy_services/round_robin.rb
PageRankr-4.4.1 lib/page_rankr/proxy_services/round_robin.rb
PageRankr-4.4.0 lib/page_rankr/proxy_services/round_robin.rb
PageRankr-4.3.0 lib/page_rankr/proxy_services/round_robin.rb
PageRankr-4.2.1 lib/page_rankr/proxy_services/round_robin.rb
PageRankr-4.2.0 lib/page_rankr/proxy_services/round_robin.rb
PageRankr-4.1.1 lib/page_rankr/proxy_services/round_robin.rb
PageRankr-4.1.0 lib/page_rankr/proxy_services/round_robin.rb
PageRankr-4.0.0 lib/page_rankr/proxy_services/round_robin.rb
PageRankr-3.2.1 lib/page_rankr/proxy_services/round_robin.rb
PageRankr-3.2.0 lib/page_rankr/proxy_services/round_robin.rb