A generic paginator object for use in any Ruby program Paginator doesn’t make any assumptions as to how data is retrieved; you just have to provide it with the total number of objects and a way to pull a specific set of objects based on the offset and number of objects per page.
Homepage: http://paginator.rubyforge.org