Class: Shamu::JsonApi::Rails::Pagination

Inherits:
Object
  • Object
show all
Includes:
Attributes, Attributes::Assignment, Attributes::Validation
Defined in:
lib/shamu/json_api/rails/pagination.rb

Overview

Pagination information gathered from the request.

Attributes collapse

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

#cursorString

Returns opaque cursor value.

Returns:

  • (String)

    opaque cursor value



37
# File 'lib/shamu/json_api/rails/pagination.rb', line 37

attribute :cursor, coerce: :to_i

#limitInteger

Returns limit the total number of results.

Returns:

  • (Integer)

    limit the total number of results.



33
# File 'lib/shamu/json_api/rails/pagination.rb', line 33

attribute :limit, coerce: :to_i

#numberInteger

Returns the page number.

Returns:

  • (Integer)

    the page number.



21
# File 'lib/shamu/json_api/rails/pagination.rb', line 21

attribute :number, coerce: :to_i

#offsetInteger

Returns offset into the list.

Returns:

  • (Integer)

    offset into the list.



29
# File 'lib/shamu/json_api/rails/pagination.rb', line 29

attribute :offset, coerce: :to_i

#paramSymbol

Returns the request parameter the pagination was read from. Default :page.

Returns:

  • (Symbol)

    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

#sizeInteger

Returns the size of each page.

Returns:

  • (Integer)

    the size of each page.



25
# File 'lib/shamu/json_api/rails/pagination.rb', line 25

attribute :size, coerce: :to_i