Generic pagination support for Ruby