Class Enumerable::Enumerator
In: ext/enumerator/enumerator.c
Parent: Object

A class which provides a method `each’ to be used as an Enumerable object.

Methods

each   new  

Included Modules

Enumerable

Public Class methods

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"]

Public Instance methods

Iterates the given block using the object and the method specified in the first place.

To view or add comments on this documentation, please go to the API wiki.

[Validate]