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.
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_next ⇒ Object (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_prev ⇒ Object (readonly)
Returns the value of attribute has_prev.
223 224 225 |
# File 'lib/pictify/types.rb', line 223 def has_prev @has_prev end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
223 224 225 |
# File 'lib/pictify/types.rb', line 223 def limit @limit end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
223 224 225 |
# File 'lib/pictify/types.rb', line 223 def page @page end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
223 224 225 |
# File 'lib/pictify/types.rb', line 223 def raw @raw end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
223 224 225 |
# File 'lib/pictify/types.rb', line 223 def total @total end |
#total_pages ⇒ Object (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
235 236 237 |
# File 'lib/pictify/types.rb', line 235 def has_next? !!@has_next end |
#has_prev? ⇒ Boolean
239 240 241 |
# File 'lib/pictify/types.rb', line 239 def has_prev? !!@has_prev end |