Method: RTX::API::Collection#all_pages

Defined in:
lib/rtx/api/collection.rb

#all_pages(initial_page = 1, &block) ⇒ Object

Allows you to loop through all of the pages and retrieve the records



110
111
112
113
114
115
116
117
# File 'lib/rtx/api/collection.rb', line 110

def all_pages(initial_page = 1, &block)
  page(initial_page)

  pages = (current_page..meta[:_total_pages]).to_a
  pages.each do |page_num|
    block.call(page(page_num).data)
  end
end