In Files

  • mrbgems/mruby-enumerator/mrblib/enumerator.rb

Parent

Methods

Included Modules

Enumerator::Generator

just for internal

Public Class Methods

new(&block) click to toggle source
 
               # File mrbgems/mruby-enumerator/mrblib/enumerator.rb, line 529
def initialize(&block)
  raise TypeError, "wrong argument type #{self.class} (expected Proc)" unless block.kind_of? Proc

  @proc = block
end
            

Public Instance Methods

each(*args, &block) click to toggle source
 
               # File mrbgems/mruby-enumerator/mrblib/enumerator.rb, line 535
def each(*args, &block)
  args.unshift Yielder.new(&block)
  @proc.call(*args)
end