Sha256: 06e68587532bb0e1f5c598451d61c25aefea71a644476e0f11af8630a7a3f2cc

Contents?: true

Size: 272 Bytes

Versions: 11

Compression:

Stored size: 272 Bytes

Contents

module T
  module Collectable

    def collect_with_cursor(collection=[], cursor=-1, &block)
      object = yield cursor
      collection += object.collection
      object.last? ? collection : collect_with_cursor(collection, object.next_cursor, &block)
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
t-0.8.2 lib/t/collectable.rb
t-0.8.1 lib/t/collectable.rb
t-0.8.0 lib/t/collectable.rb
t-0.7.0 lib/t/collectable.rb
t-0.6.4 lib/t/collectable.rb
t-0.6.3 lib/t/collectable.rb
t-0.6.2 lib/t/collectable.rb
t-0.6.1 lib/t/collectable.rb
t-0.6.0 lib/t/collectable.rb
t-0.5.1 lib/t/collectable.rb
t-0.5.0 lib/t/collectable.rb