Method: EasyPost::Services::Event#get_next_page

Defined in:
lib/easypost/services/event.rb

#get_next_page(collection, page_size = nil) ⇒ Object

Get the next page of events.



37
38
39
40
41
42
43
44
# File 'lib/easypost/services/event.rb', line 37

def get_next_page(collection, page_size = nil)
  raise EasyPost::Errors::EndOfPaginationError.new unless more_pages?(collection)

  params = { before_id: collection.events.last.id }
  params[:page_size] = page_size unless page_size.nil?

  all(params)
end