Class: Jsonapi::QueryBuilder::Paginator::Pagy
- Inherits:
-
BasePaginator
- Object
- BasePaginator
- Jsonapi::QueryBuilder::Paginator::Pagy
- Includes:
- Pagy::Backend
- Defined in:
- lib/jsonapi/query_builder/paginator/pagy.rb
Instance Attribute Summary
Attributes inherited from BasePaginator
Instance Method Summary collapse
Methods inherited from BasePaginator
Constructor Details
This class inherits a constructor from Jsonapi::QueryBuilder::Paginator::BasePaginator
Instance Method Details
#paginate(page_params) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/jsonapi/query_builder/paginator/pagy.rb', line 12 def paginate(page_params) @params = {page: page_params} pagination_details, records = pagy collection, page: page_params[:number], items: page_params[:size], outset: page_params[:offset] [records, pagination_details] end |