Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Enumerator::Product#each

() { (::Array[E]) -> void } -> self
obj.each { |...| ... } → obj
obj.each → enumerator

Iterates over the elements of the first enumerable by calling the “each_entry” method on it with the given arguments, then proceeds to the following enumerables in sequence until all of the enumerables are exhausted.

If no block is given, returns an enumerator. Otherwise, returns self.

See also .new #inspect #rewind also in 4.0 · 3.4 · 3.3 · 3.2