Class: RakutenWebService::AllProxy
- Inherits:
-
Object
- Object
- RakutenWebService::AllProxy
- Includes:
- Enumerable
- Defined in:
- lib/rakuten_web_service/all_proxy.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(search_result) ⇒ AllProxy
constructor
A new instance of AllProxy.
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
#each ⇒ Object
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 |