Class: BandwidthIris::PaginatedResult
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- BandwidthIris::PaginatedResult
- Defined in:
- lib/bandwidth-iris/paginated_result.rb
Instance Method Summary collapse
-
#initialize(items, links, &block) ⇒ PaginatedResult
constructor
A new instance of PaginatedResult.
- #next ⇒ Object
Constructor Details
#initialize(items, links, &block) ⇒ PaginatedResult
Returns a new instance of PaginatedResult.
5 6 7 8 9 |
# File 'lib/bandwidth-iris/paginated_result.rb', line 5 def initialize(items, links, &block) super(items) @links = links @requestor = block end |
Instance Method Details
#next ⇒ Object
11 12 13 14 15 |
# File 'lib/bandwidth-iris/paginated_result.rb', line 11 def next return unless @links[:next] @requestor.call(@links[:next].match(/\<([^>]+)\>/)[1].sub(/^http.*\/v1.0/, "")) end |