In Files

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

Parent

Methods

Enumerator::Generator

just for internal

Public Class Methods

new(&block) click to toggle source
 
               # File mrbgems/mruby-enumerator/mrblib/enumerator.rb, line 521
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 527
def each(*args, &block)
  args.unshift Yielder.new(&block)
  @proc.call(*args)
end