Class: Pictify::Pagination

Inherits:
Object
  • Object
show all
Defined in:
lib/pictify/types.rb

Overview

Pagination metadata returned by list_templates.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Pagination

Returns a new instance of Pagination.



231
232
233
234
235
236
237
238
239
# File 'lib/pictify/types.rb', line 231

def initialize(data)
  @raw = data
  @page = data["page"]
  @limit = data["limit"]
  @total = data["total"]
  @total_pages = data["totalPages"]
  @has_next = data["hasNext"]
  @has_prev = data["hasPrev"]
end

Instance Attribute Details

#has_nextObject (readonly)

Returns the value of attribute has_next.



229
230
231
# File 'lib/pictify/types.rb', line 229

def has_next
  @has_next
end

#has_prevObject (readonly)

Returns the value of attribute has_prev.



229
230
231
# File 'lib/pictify/types.rb', line 229

def has_prev
  @has_prev
end

#limitObject (readonly)

Returns the value of attribute limit.



229
230
231
# File 'lib/pictify/types.rb', line 229

def limit
  @limit
end

#pageObject (readonly)

Returns the value of attribute page.



229
230
231
# File 'lib/pictify/types.rb', line 229

def page
  @page
end

#rawObject (readonly)

Returns the value of attribute raw.



229
230
231
# File 'lib/pictify/types.rb', line 229

def raw
  @raw
end

#totalObject (readonly)

Returns the value of attribute total.



229
230
231
# File 'lib/pictify/types.rb', line 229

def total
  @total
end

#total_pagesObject (readonly)

Returns the value of attribute total_pages.



229
230
231
# File 'lib/pictify/types.rb', line 229

def total_pages
  @total_pages
end

Instance Method Details

#has_next?Boolean

Returns:

  • (Boolean)


241
242
243
# File 'lib/pictify/types.rb', line 241

def has_next?
  !!@has_next
end

#has_prev?Boolean

Returns:

  • (Boolean)


245
246
247
# File 'lib/pictify/types.rb', line 245

def has_prev?
  !!@has_prev
end