public class Constant extends AbstractVariable
BiVariable.Type| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
VALID_NAME |
fromRuby, irubyObject, javaObject, javaType, name, receiver| Modifier | Constructor and Description |
|---|---|
(package private) |
Constant(RubyObject receiver,
java.lang.String name,
IRubyObject irubyObject)
A constructor used when constants are retrieved from Ruby.
|
private |
Constant(RubyObject receiver,
java.lang.String name,
java.lang.Object... javaObjects) |
| Modifier and Type | Method and Description |
|---|---|
static BiVariable |
getInstance(RubyObject receiver,
java.lang.String name,
java.lang.Object... javaObject)
Returns an instance of this class.
|
BiVariable.Type |
getType()
Returns enum type of this variable defined in
BiVariable. |
void |
inject()
Injects a constant value to a parsed Ruby script.
|
static boolean |
isValidName(java.lang.Object name)
Returns true if the given name is a decent Ruby constant.
|
void |
remove()
Attempts to remove this constant from top self or receiver.
|
static void |
retrieve(RubyObject receiver,
BiVariableMap vars)
Retrieves constants from Ruby after the evaluation or method invocation.
|
static void |
retrieveByKey(RubyObject receiver,
BiVariableMap vars,
java.lang.String key)
Retrieves a constant by key from Ruby runtime after the evaluation.
|
private static void |
updateConstants(RubyObject receiver,
BiVariableMap vars) |
private static void |
updateConstantsOfSuperClass(RubyObject receiver,
BiVariableMap vars) |
getCurrentContext, getJavaObject, getName, getReceiver, getRubyClass, getRubyObject, getRuntime, getTopSelf, getTopSelf, isReceiverIdentical, isValidName, setJavaObject, setRubyObject, updateByJavaObject, updateRubyObjectprivate static final java.lang.String VALID_NAME
private Constant(RubyObject receiver, java.lang.String name, java.lang.Object... javaObjects)
Constant(RubyObject receiver, java.lang.String name, IRubyObject irubyObject)
receiver - a receiver object that this variable/constant is originally in. When
the variable/constant is originated from Ruby, receiver may not be null.name - the constant nameirubyObject - Ruby constant objectpublic static BiVariable getInstance(RubyObject receiver, java.lang.String name, java.lang.Object... javaObject)
BiVariableMap.runtime - name - a variable namejavaObject - Java object that should be assigned to.public static void retrieve(RubyObject receiver, BiVariableMap vars)
runtime - Ruby runtimereceiver - receiver object returned when a script is evaluated.vars - map to save retrieved constants.private static void updateConstantsOfSuperClass(RubyObject receiver, BiVariableMap vars)
private static void updateConstants(RubyObject receiver, BiVariableMap vars)
public static void retrieveByKey(RubyObject receiver, BiVariableMap vars, java.lang.String key)
receiver - receiver object returned when a script is evaluated.vars - map to save retrieved instance variables.key - instace varible namepublic BiVariable.Type getType()
BiVariable.public static boolean isValidName(java.lang.Object name)
name - is a name to be checked.public void inject()
public void remove()