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.



225
226
227
228
229
230
231
232
233
# File 'lib/pictify/types.rb', line 225

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.



223
224
225
# File 'lib/pictify/types.rb', line 223

def has_next
  @has_next
end

#has_prevObject (readonly)

Returns the value of attribute has_prev.



223
224
225
# File 'lib/pictify/types.rb', line 223

def has_prev
  @has_prev
end

#limitObject (readonly)

Returns the value of attribute limit.



223
224
225
# File 'lib/pictify/types.rb', line 223

def limit
  @limit
end

#pageObject (readonly)

Returns the value of attribute page.



223
224
225
# File 'lib/pictify/types.rb', line 223

def page
  @page
end

#rawObject (readonly)

Returns the value of attribute raw.



223
224
225
# File 'lib/pictify/types.rb', line 223

def raw
  @raw
end

#totalObject (readonly)

Returns the value of attribute total.



223
224
225
# File 'lib/pictify/types.rb', line 223

def total
  @total
end

#total_pagesObject (readonly)

Returns the value of attribute total_pages.



223
224
225
# File 'lib/pictify/types.rb', line 223

def total_pages
  @total_pages
end

Instance Method Details

#has_next?Boolean

Returns:

  • (Boolean)


235
236
237
# File 'lib/pictify/types.rb', line 235

def has_next?
  !!@has_next
end

#has_prev?Boolean

Returns:

  • (Boolean)


239
240
241
# File 'lib/pictify/types.rb', line 239

def has_prev?
  !!@has_prev
end