Class: RESTFramework::Paginators::BasePaginator
- Inherits:
-
Object
- Object
- RESTFramework::Paginators::BasePaginator
- Defined in:
- lib/rest_framework/paginators/base_paginator.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#get_page ⇒ Object
Get the page and return it so the caller can serialize it.
-
#get_paginated_response(serialized_page) ⇒ Object
Wrap the serialized page with appropriate metadata.
-
#initialize(data:, controller:, **kwargs) ⇒ BasePaginator
constructor
A new instance of BasePaginator.
Constructor Details
#initialize(data:, controller:, **kwargs) ⇒ BasePaginator
Returns a new instance of BasePaginator.
2 3 4 5 |
# File 'lib/rest_framework/paginators/base_paginator.rb', line 2 def initialize(data:, controller:, **kwargs) @data = data @controller = controller end |
Instance Method Details
#get_page ⇒ Object
Get the page and return it so the caller can serialize it.
8 9 10 |
# File 'lib/rest_framework/paginators/base_paginator.rb', line 8 def get_page raise NotImplementedError end |
#get_paginated_response(serialized_page) ⇒ Object
Wrap the serialized page with appropriate metadata.
13 14 15 |
# File 'lib/rest_framework/paginators/base_paginator.rb', line 13 def get_paginated_response(serialized_page) raise NotImplementedError end |