Ruby latest stable (v2_5_5) - 0 notes - Class: Enumerable::Enumerator

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_8_7_330) is shown here.

These similar methods exist in v2_5_5:

initialize_copy(p1) public

No documentation

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

Hide source
/* :nodoc: */
static VALUE
enumerator_init_copy(obj, orig)
    VALUE obj;
    VALUE orig;
    struct enumerator *ptr0, *ptr1;

    ptr0 = enumerator_ptr(orig);

    Data_Get_Struct(obj, struct enumerator, ptr1);

    if (!ptr1) {
        rb_raise(rb_eArgError, "unallocated enumerator");

    ptr1->obj  = ptr0->obj;
    ptr1->meth = ptr0->meth;
    ptr1->iter = ptr0->iter;
    ptr1->args = ptr0->args;

    return obj;
Register or log in to add new notes.