Class: CardDB::PageInfo
- Inherits:
-
Object
- Object
- CardDB::PageInfo
- Defined in:
- lib/carddb/collection.rb
Overview
Represents pagination info
Instance Attribute Summary collapse
- #end_cursor ⇒ String? readonly
- #has_next_page ⇒ Boolean readonly
- #has_previous_page ⇒ Boolean readonly
- #start_cursor ⇒ String? readonly
Instance Method Summary collapse
-
#initialize(data) ⇒ PageInfo
constructor
A new instance of PageInfo.
Constructor Details
#initialize(data) ⇒ PageInfo
Returns a new instance of PageInfo.
210 211 212 213 214 215 |
# File 'lib/carddb/collection.rb', line 210 def initialize(data) @has_next_page = data['hasNextPage'] || false @has_previous_page = data['hasPreviousPage'] || false @start_cursor = data['startCursor'] @end_cursor = data['endCursor'] end |
Instance Attribute Details
#end_cursor ⇒ String? (readonly)
208 209 210 |
# File 'lib/carddb/collection.rb', line 208 def end_cursor @end_cursor end |
#has_next_page ⇒ Boolean (readonly)
199 200 201 |
# File 'lib/carddb/collection.rb', line 199 def has_next_page @has_next_page end |
#has_previous_page ⇒ Boolean (readonly)
202 203 204 |
# File 'lib/carddb/collection.rb', line 202 def has_previous_page @has_previous_page end |
#start_cursor ⇒ String? (readonly)
205 206 207 |
# File 'lib/carddb/collection.rb', line 205 def start_cursor @start_cursor end |