Examples of toJavaArray()


Examples of org.jruby.RubyArray.toJavaArray()

        }

        @JRubyMethod(frame=true)
        public IRubyObject each(Block block) {
            RubyArray arr = (RubyArray) callMethod(getRuntime().getCurrentContext(), "value");
            for (IRubyObject obj : arr.toJavaArray()) {
                block.yield(getRuntime().getCurrentContext(), obj);
            }
            return getRuntime().getNil();
        }
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

        protected void print(int indent) {
            printIndent(indent);
            System.out.println(getMetaClass().getRealClass().getBaseName() + ": ");
            RubyArray arr = (RubyArray)callMethod(getRuntime().getCurrentContext(),"value");
            for (IRubyObject obj : arr.toJavaArray()) {
                ((ASN1Data)obj).print(indent+1);
            }
        }
    }
}// ASN1
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

                            throw context.runtime.newTypeError("append_features called with non-class");
                        }
                        RubyClass target = (RubyClass)arg;
                        RubyArray javaInterfaceMods = (RubyArray)self.getInstanceVariables().getInstanceVariable("@java_interface_mods");

                        target.include(javaInterfaceMods.toJavaArray());

                        return RuntimeHelpers.invokeAs(context, clazz.getSuperClass(), self, name, arg, block);
                    }
                });
            } else {
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

            assert restArg != null;
           
            // FIXME: not very efficient
            RubyArray splattedArgs = Helpers.splatValue(restArg);
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
            switch (totalArgs) {
            case 3:
                argValues[2] = variableValueTwo;
            case 2:
                argValues[1] = variableValueOne;
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

           
            // FIXME: not very efficient
            RubyArray splattedArgs = Helpers.splatValue(restArg);
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(variableValues, 0, argValues, 0, totalArgs);
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
           
            return argValues;
        }
    }
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

            IRubyObject restArg = getValue(staticScope.getRestArg(), 0);
           
            // FIXME: not very efficient
            RubyArray splattedArgs = Helpers.splatValue(restArg);
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
           
            if (totalArgs == 1) {
                argValues[0] = variableValueZero;
            }
           
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

            assert restArg != null;
           
            // FIXME: not very efficient
            RubyArray splattedArgs = Helpers.splatValue(restArg);
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
            switch (totalArgs) {
            case 4:
                argValues[3] = variableValueThree;
            case 3:
                argValues[2] = variableValueTwo;
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

           
            // FIXME: not very efficient
            RubyArray splattedArgs = Helpers.splatValue(restArg);
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(variableValues, 0, argValues, 0, totalArgs);
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
           
            return argValues;
        }
    }
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

            assert restArg != null;
           
            // FIXME: not very efficient
            RubyArray splattedArgs = Helpers.splatValue(restArg);
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
            switch (totalArgs) {
            case 2:
                argValues[1] = variableValueOne;
            case 1:
                argValues[0] = variableValueZero;
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

                            throw context.runtime.newTypeError("append_features called with non-class");
                        }
                        RubyClass target = (RubyClass)arg;
                        RubyArray javaInterfaceMods = (RubyArray)self.getInstanceVariables().getInstanceVariable("@java_interface_mods");

                        target.include(javaInterfaceMods.toJavaArray());

                        return Helpers.invokeAs(context, clazz.getSuperClass(), self, name, arg, block);
                    }
                });
            } else {
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.