Package org.jruby.runtime

Examples of org.jruby.runtime.JavaInternalBlockBody


    public static IRubyObject any_pCommon(ThreadContext context, IRubyObject self, final Block block, Arity callbackArity) {
        final Ruby runtime = context.runtime;

        try {
            if (block.isGiven()) {
                each(context, self, new JavaInternalBlockBody(runtime, context, "Enumerable#any?", block.arity()) {
                    public IRubyObject yield(ThreadContext context, IRubyObject[] args) {
                        IRubyObject packedArg = packEnumValues(context.runtime, args);
                        if (block.yield(context, packedArg).isTrue()) throw JumpException.SPECIAL_JUMP;
                        return runtime.getNil();
                    }
                });
            } else {
                each(context, self, new JavaInternalBlockBody(runtime, context, "Enumerable#any?", Arity.ONE_REQUIRED) {
                    public IRubyObject yield(ThreadContext context, IRubyObject[] args) {
                        IRubyObject packedArg = packEnumValues(context.runtime, args);
                        if (packedArg.isTrue()) throw JumpException.SPECIAL_JUMP;
                        return runtime.getNil();
                    }
View Full Code Here

TOP

Related Classes of org.jruby.runtime.JavaInternalBlockBody

Copyright © 2018 www.massapicom. 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.