Iterable(T)
The Iterable mixin provides convenience methods to collection classes
that provide an each method that returns an Iterator over the collection.
Instance methods
Returns an Iterator that enumerates over the items, chunking them together based on the return value of the block.
(0..7).chunk(&.//(3)).to_a # => [{0, [0, 1, 2]}, {1, [3, 4, 5]}, {2, [6, 7]}]
See also: Iterator#chunk.
Same as each.chunk_while(reuse, &block).
See also: Iterator#chunk_while.
Same as each.cons(count, reuse).
See also: Iterator#cons(count, reuse).
Same as each.slice(count, reuse).
See also: Iterator#slice(count, reuse).
Same as each.skip(offset).step(n).
See also: Iterator#step.
Same as each.with_index(offset).
See also: Iterator#with_index(offset).
Same as each.slice_after(reuse, &block).
See also: Iterator#slice_after(reuse, &block).
Same as each.slice_after(pattern, reuse).
See also: Iterator#slice_after(pattern, reuse).
Same as each.slice_before(reuse, &block).
See also: Iterator#slice_before(reuse, &block).
Same as each.slice_before(pattern, reuse).
See also: Iterator#slice_before(pattern, reuse).