Method: LabClient::PaginatedResponse#next_page

Defined in:
lib/labclient/paginated_response.rb

#next_page {|results| ... } ⇒ Object

Yields:

  • (results)

Raises:



94
95
96
97
98
99
100
101
102
103
104
# File 'lib/labclient/paginated_response.rb', line 94

def next_page
  return false unless next_page?

  @response = client.http.request(:get, @link)

  raise LabClient::Error.new(@response), @response.friendly_error unless @response.success?

  results = process
  @array.concat results
  yield results if block_given?
end