vendor/plugins/paginating_find/test_app/test/unit/paging_enumerator_test.rb
def enum(page_size, total_size, auto = nil)
    PagingEnumerator.new(page_size, total_size, auto) do |page|
      lower = page == 1 ? 0 : (page - 1) * page_size
      upper = lower + page_size - 1
      (1..total_size).to_a[lower..upper]
    end
  end
# Build the PagingEnumerable with a certain page size and
# total number of elements. Set up a callback that pages
# integers in range 1..total_size. 
Build the PagingEnumerable with a certain page size and
total number of elements. Set up a callback that pages
integers in range 1..total_size.
Build the PagingEnumerable with a certain page size and total number of elements . Set up a callback that pages integers in range 1 .. total_size .
def enum(page_size, total_size, auto = nil)
    PagingEnumerator.new(page_size, total_size, auto) do |page|
      lower = page == 1 ? 0 : (page - 1) * page_size
      upper = lower + page_size - 1
      (1..total_size).to_a[lower..upper]
    end
  end
def enum ( page_size , total_size , auto = nil ) PagingEnumerator . new ( page_size , total_size , auto ) do | page | lower = page == 1 ? 0 : ( page - 1 ) * page_size upper = lower + page_size - 1 ( 1 .. total_size ) . to_a [ lower .. upper ] end end
Build the PagingEnumerable with a certain page size and
total number of elements.
Build the PagingEnumerable with a certain page size and total number of elements .
page_size
total_size
auto