Method: Enumerable::Enumerator#initialize

Defined in:
enumerator.c

#Enumerable::Enumerator.new(obj, method = :each, *args) ⇒ Object

Creates a new Enumerable::Enumerator object, which is to be used as an Enumerable object using the given object’s given method with the given arguments.

e.g.:

str = "xyz"

enum = Enumerable::Enumerator.new(str, :each_byte)
a = enum.map {|b| '%02x' % b } #=> ["78", "79", "7a"]


218
219
220
# File 'enumerator.c', line 218

static VALUE
enumerator_initialize(argc, argv, obj)
int argc;