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 int arrayLength(IRubyObject node)
           
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 RubyArray convertToRubyArrayWithCoerce(Ruby runtime, IRubyObject value)
           
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

convertToRubyArrayWithCoerce

public static RubyArray convertToRubyArrayWithCoerce(Ruby runtime,
                                                     IRubyObject value)

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

arrayLength

public static int arrayLength(IRubyObject node)


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