Sha256: 4c2c3e0579d98b22892a5ce53f3949e157572baa4de3bfb9acb79d3941534ea0

Contents?: true

Size: 414 Bytes

Versions: 15

Compression:

Stored size: 414 Bytes

Contents

module RakutenWebService
  class AllProxy
    include Enumerable

    def initialize(search_result)
      @search_result = search_result
    end

    def each
      search_result = @search_result
      loop do
        search_result.each do |resource|
          yield resource
        end
        break unless search_result.has_next_page?
        search_result = search_result.next_page
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rakuten_web_service-1.9.0 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.8.0 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.7.0 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.6.1 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.6.0 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.5.0 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.4.2 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.4.1 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.4.0 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.3.0 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.2.0 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.1.1 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.1.0 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.0.0 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.0.0.rc1 lib/rakuten_web_service/all_proxy.rb