obj.enum_for(method = :each, *args) â enumobj.enum_for(method = :each, *args){|*args| block} â enum
Instance Public methods
Creates a new Enumerator which will enumerate
by calling method on obj, passing
args if any.
If a block is given, it will be used to calculate the size of the
enumerator without the need to iterate it (see Enumerator#size).
Examples
str = "xyz"
enum = str.enum_for(:each_byte)
enum.each { |b| puts b }
# => 120
# => 121
# => 122
# prote