org.jruby.runtime
Class Arity
java.lang.Object
org.jruby.runtime.Arity
- All Implemented Interfaces:
- java.io.Serializable
public final class Arity
- extends java.lang.Object
- implements java.io.Serializable
The arity of a method is the number of arguments it takes.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
NO_ARGUMENTS
public static final Arity NO_ARGUMENTS
ONE_ARGUMENT
public static final Arity ONE_ARGUMENT
TWO_ARGUMENTS
public static final Arity TWO_ARGUMENTS
THREE_ARGUMENTS
public static final Arity THREE_ARGUMENTS
OPTIONAL
public static final Arity OPTIONAL
ONE_REQUIRED
public static final Arity ONE_REQUIRED
TWO_REQUIRED
public static final Arity TWO_REQUIRED
THREE_REQUIRED
public static final Arity THREE_REQUIRED
createArity
public static Arity createArity(int value)
fixed
public static Arity fixed(int arity)
optional
public static Arity optional()
required
public static Arity required(int minimum)
noArguments
public static Arity noArguments()
singleArgument
public static Arity singleArgument()
twoArguments
public static Arity twoArguments()
procArityOf
public static Arity procArityOf(Node node)
getValue
public int getValue()
checkArity
public void checkArity(Ruby runtime,
IRubyObject[] args)
isFixed
public boolean isFixed()
required
public int required()
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
checkArgumentCount
public static int checkArgumentCount(Ruby runtime,
IRubyObject[] args,
int min,
int max)
scanArgs
public static IRubyObject[] scanArgs(Ruby runtime,
IRubyObject[] args,
int required,
int optional)
- See Also:
org.jruby.runtime.builtin.IRubyObject#scanArgs()
Copyright © 2002-2007 JRuby Team. All Rights Reserved.