org.jruby.ast.util
Class ArgsUtil

java.lang.Object
  extended by org.jruby.ast.util.ArgsUtil

public final class ArgsUtil
extends java.lang.Object

Author:
jpetersen

Constructor Summary
ArgsUtil()
           
 
Method Summary
static IRubyObject[] convertToJavaArray(IRubyObject value)
           
static RubyArray convertToRubyArray(Ruby runtime, IRubyObject value, boolean coerce)
          This name may be a bit misleading, since this also attempts to coerce array behavior using to_ary.
static IRubyObject[] popArray(IRubyObject[] array)
          Remove first element from array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArgsUtil

public ArgsUtil()
Method Detail

convertToJavaArray

public static IRubyObject[] convertToJavaArray(IRubyObject value)

convertToRubyArray

public static RubyArray convertToRubyArray(Ruby runtime,
                                           IRubyObject value,
                                           boolean coerce)
This name may be a bit misleading, since this also attempts to coerce array behavior using to_ary.

Parameters:
runtime - The JRuby runtime
value - The value to convert
coerce - Whether to coerce using to_ary or just wrap with an array

popArray

public static IRubyObject[] popArray(IRubyObject[] array)
Remove first element from array

Parameters:
array - to have first element "popped" off
Returns:
all but first element of the supplied array


Copyright © 2002-2007 JRuby Team. All Rights Reserved.