Class: Enumerator::Yielder
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Inherits: | Object |
| Defined in: | enumerator.c |
Overview
Yielder
Class Method Summary
- .new constructor
Instance Method Summary
- #<<(arg)
-
#to_proc
Returns a
::Procobject that takes arguments and yields them. - #yield(args)
Constructor Details
.new
[ GitHub ]# File 'enumerator.c', line 1380
static VALUE
yielder_initialize(VALUE obj)
{
rb_need_block();
return yielder_init(obj, rb_block_proc());
}
Instance Method Details
#<<(arg)
[ GitHub ]# File 'enumerator.c', line 1398
static VALUE
yielder_yield_push(VALUE obj, VALUE arg)
{
struct yielder *ptr = yielder_ptr(obj);
rb_proc_call_with_block(ptr->proc, 1, &arg, Qnil);
return obj;
}
#to_proc
# File 'enumerator.c', line 1420
static VALUE
yielder_to_proc(VALUE obj)
{
VALUE method = rb_obj_method(obj, sym_yield);
return rb_funcall(method, idTo_proc, 0);
}
#yield(args)
[ GitHub ]# File 'enumerator.c', line 1389
static VALUE
yielder_yield(VALUE obj, VALUE args)
{
struct yielder *ptr = yielder_ptr(obj);
return rb_proc_call_kw(ptr->proc, args, RB_PASS_CALLED_KEYWORDS);
}