Sha256: e2e2efc63f6d04c8d53b6f27b4470e7db91b945cbd88627148f5a44dfc59ea59

Contents?: true

Size: 421 Bytes

Versions: 1

Compression:

Stored size: 421 Bytes

Contents

module Clever
  module APIOperations
    # Handles paginated requests.
    # TODO: use rel links
    # TODO: build functionality elsewhere
    class PageList
      def initialize(uri, filters = {})
        @uri = uri
        @filters = filters
      end

      def each
        page = Page.new @uri, @filters
        until page.nil?
          yield page
          page = page.next
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
clever-ruby-0.5.0 lib/clever-ruby/api_operations/pagelist.rb