Package org.jruby.runtime.builtin

Examples of org.jruby.runtime.builtin.IRubyObject


            throw retryJumpError(context);
        }
    }

    public static IRubyObject invokeDynamicIter(DynamicMethod method, Object selfObj, ThreadContext context, String name, IRubyObject arg0, IRubyObject arg1, Block block) {
        IRubyObject self = (IRubyObject) selfObj;
        RubyClass selfType = pollAndGetClass(context, self);
        try {
            return method.call(context, self, selfType, name, arg0, arg1, block);
        } catch (JumpException.BreakJump bj) {
            return handleBreakJump(context, bj);
View Full Code Here


                return context.getRuntime().getNil();
            }
        } else {
            int index = begin + --realLength;
            try {
                final IRubyObject obj = values[index];
                values[index] = context.getRuntime().getNil();
                return obj;
            } catch (ArrayIndexOutOfBoundsException e) {
                concurrentModification();
                return context.getRuntime().getNil();
View Full Code Here

            block.escape();
        }
    }

    public static IRubyObject invokeDynamic(DynamicMethod method, Object selfObj, ThreadContext context, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) {
        IRubyObject self = (IRubyObject) selfObj;
        return method.call(context, self, self.getMetaClass(), name, arg0, arg1, arg2);
    }
View Full Code Here

    public IRubyObject shift(ThreadContext context) {
        modify();

        if (realLength == 0) return context.getRuntime().getNil();

        final IRubyObject obj;
        try {
            obj = values[begin];
            values[begin] = context.getRuntime().getNil();
        } catch (ArrayIndexOutOfBoundsException e) {
            concurrentModification();
View Full Code Here

        IRubyObject self = (IRubyObject) selfObj;
        return method.call(context, self, self.getMetaClass(), name, arg0, arg1, arg2);
    }

    public static IRubyObject invokeDynamic(DynamicMethod method, Object selfObj, ThreadContext context, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) {
        IRubyObject self = (IRubyObject) selfObj;
        RubyClass selfType = pollAndGetClass(context, self);
        try {
            return method.call(context, self, selfType, name, arg0, arg1, arg2, block);
        } catch (JumpException.BreakJump bj) {
            return handleBreakJump(context, bj);
View Full Code Here

        boolean taint = isTaint() || sep.isTaint();

        long len = 1;
        for (int i = begin; i < begin + realLength; i++) {           
            IRubyObject value;
            try {
                value = values[i];
            } catch (ArrayIndexOutOfBoundsException e) {
                concurrentModification();
                return runtime.newString("");
            }
            IRubyObject tmp = value.checkStringType();
            len += tmp.isNil() ? 10 : ((RubyString) tmp).getByteList().length();
        }

        RubyString strSep = null;
        if (!sep.isNil()) {
            sep = strSep = sep.convertToString();
            len += strSep.getByteList().length() * (realLength - 1);
        }

        ByteList buf = new ByteList((int)len);
        for (int i = begin; i < begin + realLength; i++) {
            IRubyObject tmp;
            try {
                tmp = values[i];
            } catch (ArrayIndexOutOfBoundsException e) {
                concurrentModification();
                return runtime.newString("");
            }
            if (tmp instanceof RubyString) {
                // do nothing
            } else if (tmp instanceof RubyArray) {
                if (runtime.isInspecting(tmp)) {
                    tmp = runtime.newString("[...]");
                } else {
                    tmp = inspectJoin(context, (RubyArray)tmp, sep);
                }
            } else {
                tmp = RubyString.objAsString(context, tmp);
            }

            if (i > begin && !sep.isNil()) buf.append(strSep.getByteList());

            buf.append(tmp.asString().getByteList());
            if (tmp.isTaint()) taint = true;
        }

        RubyString result = runtime.newString(buf);

        if (taint) result.setTaint(true);
View Full Code Here

            throw retryJumpError(context);
        }
    }

    public static IRubyObject invokeDynamicIter(DynamicMethod method, Object selfObj, ThreadContext context, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) {
        IRubyObject self = (IRubyObject) selfObj;
        RubyClass selfType = pollAndGetClass(context, self);
        try {
            return method.call(context, self, selfType, name, arg0, arg1, arg2, block);
        } catch (JumpException.BreakJump bj) {
            return handleBreakJump(context, bj);
View Full Code Here

            block.escape();
        }
    }

    public static IRubyObject invokeDynamic(DynamicMethod method, Object selfObj, ThreadContext context, String name, IRubyObject[] args) {
        IRubyObject self = (IRubyObject) selfObj;
        return method.call(context, self, self.getMetaClass(), name, args);
    }
View Full Code Here

        IRubyObject self = (IRubyObject) selfObj;
        return method.call(context, self, self.getMetaClass(), name, args);
    }

    public static IRubyObject invokeDynamic(DynamicMethod method, Object selfObj, ThreadContext context, String name, IRubyObject[] args, Block block) {
        IRubyObject self = (IRubyObject) selfObj;
        RubyClass selfType = pollAndGetClass(context, self);
        try {
            return method.call(context, self, selfType, name, args, block);
        } catch (JumpException.BreakJump bj) {
            return handleBreakJump(context, bj);
View Full Code Here

            throw retryJumpError(context);
        }
    }

    public static IRubyObject invokeDynamicIter(DynamicMethod method, Object selfObj, ThreadContext context, String name, IRubyObject[] args, Block block) {
        IRubyObject self = (IRubyObject) selfObj;
        RubyClass selfType = pollAndGetClass(context, self);
        try {
            return method.call(context, self, selfType, name, args, block);
        } catch (JumpException.BreakJump bj) {
            return handleBreakJump(context, bj);
View Full Code Here

TOP

Related Classes of org.jruby.runtime.builtin.IRubyObject

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.