Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Enumerator#+

e + enum → enumerator

Returns an enumerator object generated from this enumerator and a given enumerable.

Example
e = (1..3).each + [4, 5]
e.to_a #=> [1, 2, 3, 4, 5]
See also .produce #each .new #each_with_index also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1