Class: Pictify::Pagination
- Inherits:
-
Object
- Object
- Pictify::Pagination
- Defined in:
- lib/pictify/types.rb
Overview
Pagination metadata returned by list_templates.
Instance Attribute Summary collapse
-
#has_next ⇒ Object
readonly
Returns the value of attribute has_next.
-
#has_prev ⇒ Object
readonly
Returns the value of attribute has_prev.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
-
#total_pages ⇒ Object
readonly
Returns the value of attribute total_pages.
Instance Method Summary collapse
- #has_next? ⇒ Boolean
- #has_prev? ⇒ Boolean
-
#initialize(data) ⇒ Pagination
constructor
A new instance of Pagination.
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_next ⇒ Object (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_prev ⇒ Object (readonly)
Returns the value of attribute has_prev.
229 230 231 |
# File 'lib/pictify/types.rb', line 229 def has_prev @has_prev end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
229 230 231 |
# File 'lib/pictify/types.rb', line 229 def limit @limit end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
229 230 231 |
# File 'lib/pictify/types.rb', line 229 def page @page end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
229 230 231 |
# File 'lib/pictify/types.rb', line 229 def raw @raw end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
229 230 231 |
# File 'lib/pictify/types.rb', line 229 def total @total end |
#total_pages ⇒ Object (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
241 242 243 |
# File 'lib/pictify/types.rb', line 241 def has_next? !!@has_next end |
#has_prev? ⇒ Boolean
245 246 247 |
# File 'lib/pictify/types.rb', line 245 def has_prev? !!@has_prev end |