Flowdock
method

next

Importance_1
Ruby latest stable (v1_9_3_392) - 0 notes - Class: Enumerable::Enumerator
next() public

Returns the next object in the enumerator, and move the internal position forward. When the position reached at the end, internal position is rewinded then StopIteration is raised.

Note that enumeration sequence by next method does not affect other non-external enumeration methods, unless underlying iteration methods itself has side-effect, e.g. IO#each_line.

Caution: This feature internally uses Generator, which uses callcc to stop and resume enumeration to fetch each value. Use with care and be aware of the performance loss.

Show source
Register or log in to add new notes.