src code

instance method Enumerable#inGroupsOf

Enumerable#inGroupsOf(size[, filler = null]) → [group…]

Groups items in fixed-size chunks, using a specific value to fill up the last chunk if necessary.