module Pagy::Backend

def pagy_get_items(collection, pagy)

Sub-method called only by #pagy: here for easy customization of record-extraction by overriding
def pagy_get_items(collection, pagy)
  # This should work with ActiveRecord, Sequel, Mongoid...
  collection.offset(pagy.offset).limit(pagy.items)
end