Class: Enumerator::Yielder
Instance Method Summary collapse
-
#<<(arg) ⇒ Object
:nodoc:.
-
#initialize ⇒ Object
constructor
:nodoc:.
-
#to_proc ⇒ Object
Returns a Proc object that takes an argument and yields it.
-
#yield(args) ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ Object
:nodoc:
1325 1326 1327 1328 1329 1330 1331 |
# File 'enumerator.c', line 1325
static VALUE
yielder_initialize(VALUE obj)
{
rb_need_block();
return yielder_init(obj, rb_block_proc());
}
|
Instance Method Details
#<<(arg) ⇒ Object
:nodoc:
1343 1344 1345 1346 1347 1348 1349 1350 1351 |
# File 'enumerator.c', line 1343
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 ⇒ Object
1365 1366 1367 1368 1369 1370 1371 |
# File 'enumerator.c', line 1365
static VALUE
yielder_to_proc(VALUE obj)
{
VALUE method = rb_obj_method(obj, sym_yield);
return rb_funcall(method, idTo_proc, 0);
}
|
#yield(args) ⇒ Object
:nodoc:
1334 1335 1336 1337 1338 1339 1340 |
# File 'enumerator.c', line 1334
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);
}
|