core/src/main/java/org/jruby/RubyEnumerator.java
@JRubyMethod(name = "__from", meta = true, required = 2, optional = 2, visibility = PRIVATE)
    public static IRubyObject __from(ThreadContext context, IRubyObject klass, IRubyObject[] args) {
        // Lazy.__from(enum, method, *args, size)
        IRubyObject object = args[0];
        IRubyObject method = args[1];
        IRubyObject[] methodArgs;
        IRubyObject size = null; SizeFn sizeFn = null;
        if (args.length > 2) {
            methodArgs = ((RubyArray) args[2]).toJavaArrayMaybeUnsafe();
            if (args.length > 3) size = args[3];
        } else {
            methodArgs = IRubyObject.NULL_ARRAY;
        }

        RubyEnumerator instance = (RubyEnumerator) ((RubyClass) klass).allocate();

        if (size == null) {
            sizeFn = RubyEnumerable::size;
        }

        instance.initialize(context.runtime, object, method, methodArgs, size, sizeFn);
        // set: @receiver = obj.object, @method = obj.method || :each, *@args = obj.args || []
        // (for Lazy#inspect)
        instance.setInstanceVariable("@receiver", object);
        instance.setInstanceVariable("@method", method);
        instance.setInstanceVariable("@args", RubyArray.newArrayNoCopyLight(context.runtime, methodArgs));

        return instance;
    }
// used internally to create lazy without block (from Enumerator/Enumerable)
used internally to create lazy without block (from Enumerator/Enumerable)
used internally to create lazy without block ( from Enumerator / Enumerable )
@JRubyMethod(name = "__from", meta = true, required = 2, optional = 2, visibility = PRIVATE)
    public static IRubyObject __from(ThreadContext context, IRubyObject klass, IRubyObject[] args) {
        IRubyObject object = args[0];
        IRubyObject method = args[1];
        IRubyObject[] methodArgs;
        IRubyObject size = null; SizeFn sizeFn = null;
        if (args.length > 2) {
            methodArgs = ((RubyArray) args[2]).toJavaArrayMaybeUnsafe();
            if (args.length > 3) size = args[3];
        } else {
            methodArgs = IRubyObject.NULL_ARRAY;
        }
        RubyEnumerator instance = (RubyEnumerator) ((RubyClass) klass).allocate();
        if (size == null) {
            sizeFn = RubyEnumerable::size;
        }
        instance.initialize(context.runtime, object, method, methodArgs, size, sizeFn);
        instance.setInstanceVariable("@receiver", object);
        instance.setInstanceVariable("@method", method);
        instance.setInstanceVariable("@args", RubyArray.newArrayNoCopyLight(context.runtime, methodArgs));
        return instance;
    }
@ JRubyMethod ( name = "__from" , meta = true , required = 2 , optional = 2 , visibility = PRIVATE ) public static IRubyObject __from ( ThreadContext context , IRubyObject klass , IRubyObject [ ] args ) { IRubyObject object = args [ 0 ] ; IRubyObject method = args [ 1 ] ; IRubyObject [ ] methodArgs ; IRubyObject size = null ; SizeFn sizeFn = null ; if ( args . length > 2 ) { methodArgs = ( ( RubyArray ) args [ 2 ] ) . toJavaArrayMaybeUnsafe ( ) ; if ( args . length > 3 ) size = args [ 3 ] ; } else { methodArgs = IRubyObject . NULL_ARRAY ; } RubyEnumerator instance = ( RubyEnumerator ) ( ( RubyClass ) klass ) . allocate ( ) ; if ( size == null ) { sizeFn = RubyEnumerable :: size ; } instance . initialize ( context . runtime , object , method , methodArgs , size , sizeFn ) ; instance . setInstanceVariable ( "@receiver" , object ) ; instance . setInstanceVariable ( "@method" , method ) ; instance . setInstanceVariable ( "@args" , RubyArray . newArrayNoCopyLight ( context . runtime , methodArgs ) ) ; return instance ; }
used internally to create lazy without block (from Enumerator/Enumerable)
used internally to create lazy without block ( from Enumerator / Enumerable )
// Lazy.__from(enum, method, *args, size) // set: @receiver = obj.object, @method = obj.method || :each, *@args = obj.args || [] // (for Lazy#inspect)