class Aws::Resources::Collection
def limited_batches
def limited_batches ::Enumerator.new do |y| yielded = 0 @batches.each do |batch| batch = batch.take(@limit - yielded) if batch.size > 0 y.yield(batch) yielded += batch.size end break if yielded == @limit end end end