e.next_values â array
Instance Public methods
Returns the next object as an array in the enumerator, and move the
internal position forward. When the position reached at the end, StopIteration is raised.
This method can be used to distinguish yield and yield
nil.
Example
o = Object.new
def o.each
yield
yield 1
yield 1, 2
yield nil
yield [1, 2]
end
e = o.to_enum
p e.next_values
p e.next_values
p e.next_values
p e.next_values
p e.next_values
e = o.to_enum
p e.next
p e.n