class GdsApi::ListResponse
def with_subsequent_pages
point. Note that the responses are stored so subsequent pages will not be
invoke a method such as #count, this method will fetch all pages at that
fetching pages as results from the current page are exhausted. If you
Pages of results are fetched on demand. When iterating, that means
list_response.with_subsequent_pages.count
or:
end
...
list_response.with_subsequent_pages.each do |result|
Example:
or #results which only iterate over the current page.
Transparently get all results across all pages. Compare this with #each
def with_subsequent_pages Enumerator.new { |yielder| self.each do |i| yielder << i end if has_next_page? next_page.with_subsequent_pages.each do |i| yielder << i end end } end