Class: Canvas::ResultSet
- Inherits:
-
Array
- Object
- Array
- Canvas::ResultSet
- Defined in:
- lib/canvas/canvas_api.rb
Instance Attribute Summary collapse
-
#link ⇒ Object
Returns the value of attribute link.
-
#next_endpoint ⇒ Object
Returns the value of attribute next_endpoint.
Instance Method Summary collapse
-
#initialize(api, arr) ⇒ ResultSet
constructor
A new instance of ResultSet.
- #more? ⇒ Boolean
- #next_page! ⇒ Object
Constructor Details
#initialize(api, arr) ⇒ ResultSet
299 300 301 302 |
# File 'lib/canvas/canvas_api.rb', line 299 def initialize(api, arr) @api = api super(arr) end |
Instance Attribute Details
#link ⇒ Object
Returns the value of attribute link.
305 306 307 |
# File 'lib/canvas/canvas_api.rb', line 305 def link @link end |
#next_endpoint ⇒ Object
Returns the value of attribute next_endpoint.
304 305 306 |
# File 'lib/canvas/canvas_api.rb', line 304 def next_endpoint @next_endpoint end |
Instance Method Details
#more? ⇒ Boolean
307 308 309 |
# File 'lib/canvas/canvas_api.rb', line 307 def more? !!next_endpoint end |
#next_page! ⇒ Object
311 312 313 314 315 316 317 318 |
# File 'lib/canvas/canvas_api.rb', line 311 def next_page! ResultSet.new(@api, []) unless next_endpoint more = @api.get(next_endpoint) concat(more) @next_endpoint = more.next_endpoint @link = more.link more end |