Class: Mirah::Data::PageInfo
- Inherits:
-
BaseObject
- Object
- BaseObject
- Mirah::Data::PageInfo
- Defined in:
- lib/mirah/data/page_info.rb
Overview
PageInfo gives information on the current state of paging as returned by the server. This includes information about the start and the end cursors of the result set, and whether or not there are additiona pages. This can be used in combination with Filters::Paging to make a stable cursor-based pagination call.
Instance Attribute Summary collapse
-
#end_cursor ⇒ string
readonly
The cursor of the last record of the current set.
-
#has_next_page ⇒ Boolean
readonly
Whether the data set has a next page.
-
#has_previous_page ⇒ Boolean
readonly
Whether the data set has a next page.
-
#start_cursor ⇒ string
readonly
The cursor of the first record of the current set.
Instance 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
#end_cursor ⇒ string (readonly)
Returns The cursor of the last record of the current set. This can be used as a starting point for the next page of the query.
12 |
# File 'lib/mirah/data/page_info.rb', line 12 attribute :end_cursor |
#has_next_page ⇒ Boolean (readonly)
Returns Whether the data set has a next page.
21 |
# File 'lib/mirah/data/page_info.rb', line 21 attribute :has_next_page |
#has_previous_page ⇒ Boolean (readonly)
Returns Whether the data set has a next page.
25 |
# File 'lib/mirah/data/page_info.rb', line 25 attribute :has_previous_page |
#start_cursor ⇒ string (readonly)
Returns The cursor of the first record of the current set. This can be used to get the previous page.
17 |
# File 'lib/mirah/data/page_info.rb', line 17 attribute :start_cursor |
Instance Method Details
#next_page? ⇒ Boolean
29 30 31 |
# File 'lib/mirah/data/page_info.rb', line 29 def next_page? has_next_page end |
#prev_page? ⇒ Boolean
35 36 37 |
# File 'lib/mirah/data/page_info.rb', line 35 def prev_page? has_previous_page end |