Sha256: 914d977bd88a488c0fb868ede03bdd601b01771ecba89297042ac2b80603495f

Contents?: true

Size: 442 Bytes

Versions: 3

Compression:

Stored size: 442 Bytes

Contents

# frozen_string_literal: true

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.next_page?

        search_result = search_result.next_page
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rakuten_web_service-1.13.2 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.13.1 lib/rakuten_web_service/all_proxy.rb
rakuten_web_service-1.13.0 lib/rakuten_web_service/all_proxy.rb