Package org.jruby

Examples of org.jruby.Ruby.newBoolean()


                        runtime.getNil() :
                        RubyString.newString(runtime, se.getAnchor());
                    IRubyObject tag = se.getTag() == null ?
                        runtime.getNil() :
                        RubyString.newString(runtime, se.getTag());
                    IRubyObject plain_implicit = runtime.newBoolean(se.getImplicit().isFirst());
                    IRubyObject quoted_implicit = runtime.newBoolean(se.getImplicit().isSecond());
                    IRubyObject style = runtime.newFixnum(se.getStyle());
                    IRubyObject val = RubyString.newString(runtime, se.getValue());

                    invoke(
View Full Code Here


                        RubyString.newString(runtime, se.getAnchor());
                    IRubyObject tag = se.getTag() == null ?
                        runtime.getNil() :
                        RubyString.newString(runtime, se.getTag());
                    IRubyObject plain_implicit = runtime.newBoolean(se.getImplicit().isFirst());
                    IRubyObject quoted_implicit = runtime.newBoolean(se.getImplicit().isSecond());
                    IRubyObject style = runtime.newFixnum(se.getStyle());
                    IRubyObject val = RubyString.newString(runtime, se.getValue());

                    invoke(
                            context,
View Full Code Here

                        runtime.getNil() :
                        RubyString.newString(runtime, sse.getAnchor());
                    IRubyObject tag = sse.getTag() == null ?
                        runtime.getNil() :
                        RubyString.newString(runtime, sse.getTag());
                    IRubyObject implicit = runtime.newBoolean(sse.getImplicit());
                    IRubyObject style = runtime.newFixnum(sse.getFlowStyle() ? 1 : 0);

                    invoke(
                            context,
                            handler,
View Full Code Here

                        runtime.getNil() :
                        RubyString.newString(runtime, mse.getAnchor());
                    IRubyObject tag = mse.getTag() == null ?
                        runtime.getNil() :
                        RubyString.newString(runtime, mse.getTag());
                    IRubyObject implicit = runtime.newBoolean(mse.getImplicit());
                    IRubyObject style = runtime.newFixnum(mse.getFlowStyle() ? 1 : 0);

                    invoke(
                            context,
                            handler,
View Full Code Here

    @JRubyMethod(name = "equal?")
    public IRubyObject equal_p(ThreadContext context, IRubyObject other) {
        Ruby runtime = context.getRuntime();
        if (other instanceof JavaProxy) {
            boolean equal = getObject() == ((JavaProxy)other).getObject();
            return runtime.newBoolean(equal);
        }
        return runtime.getFalse();
    }

    @JRubyMethod(backtrace = true)
View Full Code Here

        if (myValue == null && otherValue == null) {
            return runtime.getTrue();
        }

        return runtime.newBoolean(myValue.equals(otherValue));
    }

    @JRubyMethod(name = "equal?", required = 1)
    public IRubyObject same(IRubyObject other) {
        Ruby runtime = getRuntime();
View Full Code Here

        if (excType instanceof RubyArray) {
            RubyArray testTypes = (RubyArray)excType;
            for (int i = 0, n = testTypes.getLength(); i < n; i++) {
                IRubyObject testType = (IRubyObject)testTypes.eltInternal(i);
                boolean handled = isUndefExc ? testType.isTrue() : exceptionHandled(context, testType, excObj);
                if (handled) return runtime.newBoolean(true);
            }
            return runtime.newBoolean(false);
        } else {
            return isUndefExc ? excType : runtime.newBoolean(exceptionHandled(context, excType, excObj));
        }
View Full Code Here

            for (int i = 0, n = testTypes.getLength(); i < n; i++) {
                IRubyObject testType = (IRubyObject)testTypes.eltInternal(i);
                boolean handled = isUndefExc ? testType.isTrue() : exceptionHandled(context, testType, excObj);
                if (handled) return runtime.newBoolean(true);
            }
            return runtime.newBoolean(false);
        } else {
            return isUndefExc ? excType : runtime.newBoolean(exceptionHandled(context, excType, excObj));
        }
    }
View Full Code Here

                boolean handled = isUndefExc ? testType.isTrue() : exceptionHandled(context, testType, excObj);
                if (handled) return runtime.newBoolean(true);
            }
            return runtime.newBoolean(false);
        } else {
            return isUndefExc ? excType : runtime.newBoolean(exceptionHandled(context, excType, excObj));
        }
    }

    @Override
    public void visit(IRVisitor visitor) {
View Full Code Here

    @Override
    public Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block block) {
        Ruby runtime = context.runtime;
       
        return runtime.newBoolean(runtime.getGlobalVariables().isDefined(getName().string));
    }

    @Override
    public void visit(IRVisitor visitor) {
        visitor.GlobalIsDefinedInstr(this);
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.