Enumerator
class Enumerator
A class which allows both internal and external iteration.
An Enumerator can be created by the following methods.
-
Kernel#to_enum
-
Kernel#enum_for
Most methods have two forms: a block form where the contents are evaluated for each item in the enumeration, and a non-block form which returns a new Enumerator wrapping the iteration.
enumerator = %w(one two three).each put