# File lib/aws/core/collection.rb, line 152 def in_groups_of size, options = {}, &block group = [] nil_or_next_token = each_batch(options) do |batch| batch.each do |item| group << item if group.size == size yield(group) group = [] end end end yield(group) unless group.empty? nil_or_next_token end