Examples of convertToArray()


Examples of org.jruby.runtime.builtin.IRubyObject.convertToArray()

    public void printBacktrace(PrintStream errorStream) {
        IRubyObject backtrace = callMethod(getRuntime().getCurrentContext(), "backtrace");
        boolean debug = getRuntime().getDebug().isTrue();
        if (!backtrace.isNil() && backtrace instanceof RubyArray) {
            IRubyObject[] elements = backtrace.convertToArray().toJavaArray();

            for (int i = 1; i < elements.length; i++) {
                IRubyObject stackTraceLine = elements[i];
                    if (stackTraceLine instanceof RubyString) {
                    printStackTraceLine(errorStream, stackTraceLine);
View Full Code Here

Examples of org.jruby.runtime.builtin.IRubyObject.convertToArray()

          String marshalled = getMarshal().callMethod(data.runtime.getCurrentContext(), "dump", rubyVal).toString();
          javaValue = new RubyStepMarshalledObject(marshalled);
          break;
        case ValueMeta.TYPE_BINARY:
          // TODO: provide meaningful error message if this fails
          RubyArray arr = rubyVal.convertToArray();

          byte[] bytes = new byte[arr.size()];
          for (int i = 0; i < bytes.length; i++) {
            Object rItem = arr.get(i);
            if (rItem instanceof Number) {
View Full Code Here

Examples of org.jruby.runtime.builtin.IRubyObject.convertToArray()

    }

    public void printBacktrace(PrintStream errorStream) {
        IRubyObject backtrace = callMethod(getRuntime().getCurrentContext(), "backtrace");
        if (!backtrace.isNil() && backtrace instanceof RubyArray) {
            IRubyObject[] elements = backtrace.convertToArray().toJavaArray();

            for (int i = 1; i < elements.length; i++) {
                IRubyObject stackTraceLine = elements[i];
                if (stackTraceLine instanceof RubyString) {
                    printStackTraceLine(errorStream, stackTraceLine);
View Full Code Here

Examples of org.jruby.runtime.builtin.IRubyObject.convertToArray()

     * @param errorStream the PrintStream to which backtrace should be printed
     */
    public void printBacktrace(PrintStream errorStream, int skip) {
        IRubyObject backtrace = callMethod(getRuntime().getCurrentContext(), "backtrace");
        if (!backtrace.isNil() && backtrace instanceof RubyArray) {
            IRubyObject[] elements = backtrace.convertToArray().toJavaArray();

            for (int i = skip; i < elements.length; i++) {
                IRubyObject stackTraceLine = elements[i];
                if (stackTraceLine instanceof RubyString) {
                    printStackTraceLine(errorStream, stackTraceLine);
View Full Code Here

Examples of org.jruby.runtime.builtin.IRubyObject.convertToArray()

        // consistent way.  We should consider re-impling all IO/File construction
        // logic.
        if (options.containsKey(runtime.newSymbol("open_args"))) {
            IRubyObject args = options.fastARef(runtime.newSymbol("open_args"));
           
            RubyArray openArgs = args.convertToArray();
           
            for (int i = 0; i < openArgs.size(); i++) {
                IRubyObject arg = openArgs.eltInternal(i);
               
                if (arg instanceof RubyString) { // Overrides all?
View Full Code Here

Examples of org.jruby.runtime.builtin.IRubyObject.convertToArray()

     * @param errorStream the PrintStream to which backtrace should be printed
     */
    public void printBacktrace(PrintStream errorStream, int skip) {
        IRubyObject trace = callMethod(getRuntime().getCurrentContext(), "backtrace");
        if (!trace.isNil() && trace instanceof RubyArray) {
            IRubyObject[] elements = trace.convertToArray().toJavaArray();

            for (int i = skip; i < elements.length; i++) {
                IRubyObject stackTraceLine = elements[i];
                if (stackTraceLine instanceof RubyString) {
                    printStackTraceLine(errorStream, stackTraceLine);
View Full Code Here

Examples of org.jruby.runtime.builtin.IRubyObject.convertToArray()

        // consistent way.  We should consider re-impling all IO/File construction
        // logic.
        if (options.containsKey(runtime.newSymbol("open_args"))) {
            IRubyObject args = options.fastARef(runtime.newSymbol("open_args"));
           
            RubyArray openArgs = args.convertToArray();
           
            for (int i = 0; i < openArgs.size(); i++) {
                IRubyObject arg = openArgs.eltInternal(i);
               
                if (arg instanceof RubyString) { // Overrides all?
View Full Code Here

Examples of org.jruby.runtime.builtin.IRubyObject.convertToArray()

    public static IRubyObject[] openArgsToArgs(Ruby runtime, IRubyObject firstElement, RubyHash options) {
        IRubyObject value = hashARef(runtime, options, "open_args");
       
        if (value.isNil()) return new IRubyObject[] { firstElement, options };
       
        RubyArray array = value.convertToArray();
       
        IRubyObject[] openArgs = new IRubyObject[array.size()];
        value.convertToArray().toArray(openArgs);
        IRubyObject[] args = new IRubyObject[openArgs.length + 1];
       
View Full Code Here

Examples of org.jruby.runtime.builtin.IRubyObject.convertToArray()

        if (value.isNil()) return new IRubyObject[] { firstElement, options };
       
        RubyArray array = value.convertToArray();
       
        IRubyObject[] openArgs = new IRubyObject[array.size()];
        value.convertToArray().toArray(openArgs);
        IRubyObject[] args = new IRubyObject[openArgs.length + 1];
       
        args[0] = firstElement;
       
        System.arraycopy(openArgs, 0, args, 1, openArgs.length);
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.typing.TypeRegistry.convertToArray()

      else
      {
        throw ee;
      }
    }
    final ArrayCallback parameter = typeRegistry.convertToArray(parameters.getType(2), parameters.getValue(2));

    final LinkCustomizer pattern = createLinkCustomizer(configIndicator);
    return new TypeValuePair(TextType.TYPE, pattern.format(context, configIndicator, path,
        computeParameterEntries(parameter, typeRegistry)));
  }
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.