Class: Qismo::Collection
- Inherits:
-
Array
- Object
- Array
- Qismo::Collection
- Defined in:
- lib/qismo/collection.rb
Overview
Class to handle paginated response from API
Instance Attribute Summary collapse
-
#next_page ⇒ Object
readonly
Returns the value of attribute next_page.
-
#prev_page ⇒ Object
readonly
Returns the value of attribute prev_page.
Instance Method Summary collapse
-
#initialize(data, prev_page: nil, next_page: nil) ⇒ Collection
constructor
Collection object.
Constructor Details
#initialize(data, prev_page: nil, next_page: nil) ⇒ Collection
Collection object
11 12 13 14 15 16 |
# File 'lib/qismo/collection.rb', line 11 def initialize(data, prev_page: nil, next_page: nil) super(data) @prev_page = prev_page @next_page = next_page end |
Instance Attribute Details
#next_page ⇒ Object (readonly)
Returns the value of attribute next_page.
18 19 20 |
# File 'lib/qismo/collection.rb', line 18 def next_page @next_page end |
#prev_page ⇒ Object (readonly)
Returns the value of attribute prev_page.
19 20 21 |
# File 'lib/qismo/collection.rb', line 19 def prev_page @prev_page end |