new(p1) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
static VALUE
generator_initialize(int argc, VALUE *argv, VALUE obj)
{
    VALUE proc;

    if (argc == 0) {
        rb_need_block();

        proc = rb_block_proc();
    }
    else {
        rb_scan_args(argc, argv, "1", &proc);

        if (!rb_obj_is_proc(proc))
            rb_raise(rb_eTypeError,
                     "wrong argument type %"PRIsVALUE" (expected Proc)",
                     rb_obj_class(proc));

        if (rb_block_given_p()) {
            rb_warn("given block not used");
        }
    }

    return generator_init(obj, proc);
}
Register or log in to add new notes.