Paginator is a very simple and easy to use library for paginating Array-like objects.
If you find yourself needing to paginate large arrays(JSON data?), this library is there to help you out.
I think the SLOC of this library is 37 lines. It's really tiny!
The example below is just a sample.
Check out the Wiki for a sample of other features in guide-style documentation!
#!/usr/bin/env ruby require 'paginator' people = Paginator.new %w(bob tom eddie kate), 2 people.page 1 # => %w(bob tom) people.page 2 # => %w(eddie kate)
$ git clone git://github.com/robgleeson/paginator.git $ cd paginator $ gem build *.gemspec $ gem install *.gem
Paginator is released under the MIT License.
See LICENSE for details!