Class: Jsonapi::QueryBuilder::Paginator::Keyset

Inherits:
BasePaginator show all
Defined in:
lib/jsonapi/query_builder/paginator/keyset.rb

Constant Summary collapse

DEFAULT_DIRECTION =
:after
DEFAULT_LIMIT =
25

Instance Attribute Summary

Attributes inherited from BasePaginator

#collection

Instance Method Summary collapse

Methods inherited from BasePaginator

#initialize

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
# File 'lib/jsonapi/query_builder/paginator/keyset.rb', line 12

def paginate(page_params)
  page_params = extract_pagination_params(page_params)
  records = apply_pagination(collection, page_params)

  [records, page_params]
end