Package org.jruby

Examples of org.jruby.RubyArray.each()


            Block block) {
        // TODO: yield block while iterating
        RubyArray files = mapToPathnames(context, (RubyClass) recv,
                context.runtime.getDir().callMethod(context, "glob", args));
        if (block.isGiven()) {
            files.each(context, block);
            return context.nil;
        } else {
            return files;
        }
    }
View Full Code Here


    @JRubyMethod
    public IRubyObject each_entry(ThreadContext context, Block block) {
        if (block.isGiven()) {
            // TODO: yield block while iterating
            RubyArray entries = callMethod(context, "entries").convertToArray();
            entries.each(context, block);
            return context.nil;
        } else {
            return context.runtime.getDir().callMethod(context, "foreach");
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.