Class: RakutenWebService::AllProxy

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/rakuten_web_service/all_proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(search_result) ⇒ AllProxy

Returns a new instance of AllProxy.



5
6
7
# File 'lib/rakuten_web_service/all_proxy.rb', line 5

def initialize(search_result)
  @search_result = search_result
end

Instance Method Details

#eachObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/rakuten_web_service/all_proxy.rb', line 9

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