Class: Enumerator

### Home Classes Methods

### In Files

- lib/backports/1.9.1/enumerator/new.rb
- lib/backports/2.0.0/enumerable/lazy.rb

### Parent

Object

### Namespace

- CLASS Enumerator::GeneratorBP
- CLASS Enumerator::Lazy
- CLASS Enumerator::Yielder

### Methods

- #initialize_with_optional_block

### Class/Module Index

Quicksearch

- Prime
- Prime::EratosthenesGenerator
- Prime::EratosthenesSieve
- Prime::Generator23
- Prime::OldCompatibility
- Prime::PseudoPrimeGenerator
- Prime::TrialDivision
- Prime::TrialDivisionGenerator
- Backports
- Backports::MOST_EXTREME_OBJECT_EVER
- Backports::Random
- Backports::Random::Implementation
- Backports::Random::MT19937
- Backports::StdLib
- Backports::StdLib::LoadedFeatures
- Enumerator
- Enumerator::GeneratorBP
- Enumerator::Lazy
- Enumerator::Yielder
- Matrix
- Matrix::EigenvalueDecomposition
- Matrix::LUPDecomposition
- Enumerable
- Enumerable::Enumerator
- File
- File::Constants
- ARGF
- Array
- BasicObject
- Bignum
- Binding
- Complex
- Dir
- ENV
- Fixnum
- Float
- GC
- Hash
- IO
- Integer
- Kernel
- Math
- Method
- Module
- NilClass
- Numeric
- Object
- ObjectSpace
- OpenStruct
- Proc
- Process
- Random
- Range
- Regexp
- Set
- StopIteration
- String
- Struct
- Symbol
- UnboundMethod

No matching classes.

# Enumerator

new with block, standard in Ruby 1.9

### Public Instance Methods

initialize_with_optional_block(*arg, &block) click to toggle source

    # File lib/backports/1.9.1/enumerator/new.rb, line 34
    def initialize_with_optional_block(*arg, &block)
      return initialize_without_optional_block(*arg, &nil) unless arg.empty?  # Ruby 1.9 apparently ignores the block if any argument is present
      initialize_without_optional_block(GeneratorBP.new(&block))
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.