lib/ripple/document/finders.rb in ripple-0.5.1 vs lib/ripple/document/finders.rb in ripple-0.6.0
- old
+ new
@@ -44,16 +44,17 @@
# @overload all()
# Get all documents and return them in an array.
# @return [Array<Document>] all found documents in the bucket
# @overload all() {|doc| ... }
# Stream all documents in the bucket through the block.
- # TODO: Make this work with the CurbBackend (currently single-request oriented).
# @yield [Document] doc a found document
def all
if block_given?
- bucket.keys do |key|
- obj = find_one(key)
- yield obj if obj
+ bucket.keys do |keys|
+ keys.each do |key|
+ obj = find_one(key)
+ yield obj if obj
+ end
end
[]
else
bucket.keys.inject([]) do |acc, k|
obj = find_one(k)