Class: Shamu::JsonApi::Rails::Pagination
- Inherits:
-
Object
- Object
- Shamu::JsonApi::Rails::Pagination
- Includes:
- Attributes, Attributes::Assignment, Attributes::Validation
- Defined in:
- lib/shamu/json_api/rails/pagination.rb
Overview
Pagination information gathered from the request.
Attributes collapse
-
#cursor ⇒ String
Opaque cursor value.
-
#limit ⇒ Integer
Limit the total number of results.
-
#number ⇒ Integer
The page number.
-
#offset ⇒ Integer
Offset into the list.
-
#param ⇒ Symbol
The request parameter the pagination was read from.
-
#size ⇒ Integer
The size of each page.
Method Summary
Methods included from Attributes::Validation
attribute, #valid?, #validated?
Methods included from Attributes::Assignment
#[]=, #assigned?, #assigned_attributes, attribute, #unassigned_attributes
Methods included from Attributes
#[], #assign_attributes, association, associations, attribute, #attribute?, attributes, #initialize, #set?, #slice, #to_attributes
Instance Attribute Details
#cursor ⇒ String
Returns opaque cursor value.
37 |
# File 'lib/shamu/json_api/rails/pagination.rb', line 37 attribute :cursor, coerce: :to_i |
#limit ⇒ Integer
Returns limit the total number of results.
33 |
# File 'lib/shamu/json_api/rails/pagination.rb', line 33 attribute :limit, coerce: :to_i |
#number ⇒ Integer
Returns the page number.
21 |
# File 'lib/shamu/json_api/rails/pagination.rb', line 21 attribute :number, coerce: :to_i |
#offset ⇒ Integer
Returns offset into the list.
29 |
# File 'lib/shamu/json_api/rails/pagination.rb', line 29 attribute :offset, coerce: :to_i |
#param ⇒ Symbol
Returns the request parameter the pagination was read from. Default :page
.
17 |
# File 'lib/shamu/json_api/rails/pagination.rb', line 17 attribute :param, default: :page |
#size ⇒ Integer
Returns the size of each page.
25 |
# File 'lib/shamu/json_api/rails/pagination.rb', line 25 attribute :size, coerce: :to_i |