Class: Mirah::Filters::Paging
- Inherits:
-
BaseObject
- Object
- BaseObject
- Mirah::Filters::Paging
- Defined in:
- lib/mirah/filters/paging.rb
Overview
A set of input parameters designed to let you select how many and which records you want from a pagination cursor. It is based on Graphql’s Relay specification. This can be used with Data::PageInfo, which will be provided by the results of a server query, to provide stable pagination framework.
Instance Attribute Summary collapse
-
#after ⇒ string
readonly
Return rows after the given cursor position.
-
#before ⇒ string
readonly
Return rows before the given cursor position.
-
#first ⇒ string
readonly
Return the first N rows from either the start, or the current cursor position.
-
#last ⇒ string
readonly
Return the last N rows from either the end, or the current cursor position.
Class Method Summary collapse
Methods inherited from BaseObject
from_graphql_hash, #initialize, #to_graphql_hash
Constructor Details
This class inherits a constructor from Mirah::BaseObject
Instance Attribute Details
#after ⇒ string (readonly)
Return rows after the given cursor position
26 |
# File 'lib/mirah/filters/paging.rb', line 26 attribute :after |
#before ⇒ string (readonly)
Return rows before the given cursor position
22 |
# File 'lib/mirah/filters/paging.rb', line 22 attribute :before |
#first ⇒ string (readonly)
Return the first N rows from either the start, or the current cursor position. Cannot be used at the same time as #last
13 |
# File 'lib/mirah/filters/paging.rb', line 13 attribute :first |
#last ⇒ string (readonly)
Return the last N rows from either the end, or the current cursor position. Cannot be used at the same time as #first
18 |
# File 'lib/mirah/filters/paging.rb', line 18 attribute :last |
Class Method Details
.default ⇒ Object
28 29 30 |
# File 'lib/mirah/filters/paging.rb', line 28 def self.default new(first: 100) end |