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.

[Validate]

ruby-doc.org is a service of James Britt and Neurogami, a Ruby application development company in Phoenix, AZ.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.