Class: Jsonapi::QueryBuilder::Paginator::BasePaginator
- Inherits:
-
Object
- Object
- Jsonapi::QueryBuilder::Paginator::BasePaginator
- Defined in:
- lib/jsonapi/query_builder/paginator/base_paginator.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
Instance Method Summary collapse
-
#initialize(collection) ⇒ BasePaginator
constructor
A new instance of BasePaginator.
-
#paginate(page_params) ⇒ [ActiveRecord::Relation, Hash]
Records and pagination details.
Constructor Details
#initialize(collection) ⇒ BasePaginator
Returns a new instance of BasePaginator.
10 11 12 |
# File 'lib/jsonapi/query_builder/paginator/base_paginator.rb', line 10 def initialize(collection) @collection = collection end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
7 8 9 |
# File 'lib/jsonapi/query_builder/paginator/base_paginator.rb', line 7 def collection @collection end |
Instance Method Details
#paginate(page_params) ⇒ [ActiveRecord::Relation, Hash]
Returns Records and pagination details.
16 17 18 |
# File 'lib/jsonapi/query_builder/paginator/base_paginator.rb', line 16 def paginate(page_params) raise NotImplementedError, "#{self.class} should implement ##{__method__}" end |