Class Paginator
In: lib/paginator.rb
Parent: Object
Paginator Enumerable dot/f_3.png


each   first   last   new   number_of_pages   page  

Included Modules


Classes and Modules

Class Paginator::ArgumentError
Class Paginator::MissingCountError
Class Paginator::MissingSelectError
Class Paginator::Page


VERSION = '1.1.0'


count  [R] 
per_page  [R] 

Public Class methods

Instantiate a new Paginator object


  • A total count of the number of objects to paginate
  • The number of objects in each page
  • A block that returns the array of items
    • The block is passed the item offset (and the number of items to show per page, for convenience, if the arity is 2)

Public Instance methods

First page object

Last page object

Total number of pages

Retrieve page object by number