Add Hash support to fetch_all (#586)
This commit aligns the behavior of `fetch_all` over map responses with that of arrays (returning a single collection with all entries).
This commit is contained in:
1 parent
9237ba59cb
commit
e3792b19d2
2 files changed
+13
-3
No files matched your search
@@ -69,6 +69,12 @@ module Google
|
||||
break if @max && item_count > @max
|
||||
yield item
|
||||
end
|
||||
elsif items.kind_of?(Hash)
|
||||
items.each do |key, val|
|
||||
item_count = item_count + 1
|
||||
break if @max && item_count > @max
|
||||
yield key, val
|
||||
end
|
||||
elsif items
|
||||
# yield singular non-nil items (for genomics API)
|
||||
yield items
|
||||
|
||||
Reference in new issue
Block a user