Class: CardDB::PageInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/carddb/collection.rb

Overview

Represents pagination info

Instance Attribute Summary collapse

Instance Method Summary collapse

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_cursorString? (readonly)

Returns:

  • (String, nil)


208
209
210
# File 'lib/carddb/collection.rb', line 208

def end_cursor
  @end_cursor
end

#has_next_pageBoolean (readonly)

Returns:

  • (Boolean)


199
200
201
# File 'lib/carddb/collection.rb', line 199

def has_next_page
  @has_next_page
end

#has_previous_pageBoolean (readonly)

Returns:

  • (Boolean)


202
203
204
# File 'lib/carddb/collection.rb', line 202

def has_previous_page
  @has_previous_page
end

#start_cursorString? (readonly)

Returns:

  • (String, nil)


205
206
207
# File 'lib/carddb/collection.rb', line 205

def start_cursor
  @start_cursor
end