Sha256: cbe1c634ffd60ec9a6ddf48d603537a2884286dac855048232fa961749cbca14

Contents?: true

Size: 275 Bytes

Versions: 1

Compression:

Stored size: 275 Bytes

Contents

module T
  module Collectable

    def collect_with_cursor(collection=[], cursor=-1, &block)
      return collection if cursor == 0
      object = yield cursor
      collection += object.collection
      collect_with_cursor(collection, object.next_cursor)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
t-0.3.0 lib/t/collectable.rb