public class LocalGlobalVariable extends GlobalVariable
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) |
LocalGlobalVariable(RubyObject receiver,
java.lang.String name,
IRubyObject irubyObject)
A constructor used when local global type variables are retrieved from Ruby.
|
private |
LocalGlobalVariable(RubyObject receiver,
java.lang.String name,
java.lang.Object... javaObject) |
| 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 global value to a parsed Ruby script.
|
static boolean |
isValidName(java.lang.Object name)
Returns true if the given name is a local global type variable.
|
void |
remove()
Removes this object from
BiVariableMap. |
static void |
retrieve(RubyObject receiver,
BiVariableMap vars)
Retrieves global variables eagerly from Ruby right after the evaluation.
|
static void |
retrieveByKey(Ruby runtime,
BiVariableMap vars,
java.lang.String name)
Retrieves a global variable by key from Ruby runtime after the evaluation.
|
private static void |
updateLocalGlobal(RubyObject receiver,
BiVariableMap vars,
java.lang.String name,
IRubyObject value) |
isPredefined, isReceiverIdentical, retrieve, setJavaObject, tryEagerInjection, tryEagerInjectiongetCurrentContext, getJavaObject, getName, getReceiver, getRubyClass, getRubyObject, getRuntime, getTopSelf, getTopSelf, isValidName, setRubyObject, updateByJavaObject, updateRubyObjectprivate static final java.lang.String VALID_NAME
private LocalGlobalVariable(RubyObject receiver, java.lang.String name, java.lang.Object... javaObject)
LocalGlobalVariable(RubyObject receiver, java.lang.String name, IRubyObject irubyObject)
name - the local global type variable nameirubyObject - Ruby global objectpublic static BiVariable getInstance(RubyObject receiver, java.lang.String name, java.lang.Object... javaObject)
BiVariableMap.runtime - Ruby runtimename - a variable namejavaObject - Java object that should be assigned to.public static void retrieve(RubyObject receiver, BiVariableMap vars)
receiver - receiver object returned when a script is evaluated.vars - map to save retrieved global variables.private static void updateLocalGlobal(RubyObject receiver, BiVariableMap vars, java.lang.String name, IRubyObject value)
public static void retrieveByKey(Ruby runtime, BiVariableMap vars, java.lang.String name)
runtime - Ruby runtimevars - map to save a retrieved global variable.name - name of the global variablepublic BiVariable.Type getType()
BiVariable.getType in interface BiVariablegetType in class GlobalVariablepublic static boolean isValidName(java.lang.Object name)
name - is a name to be checked.public void inject()
inject in interface BiVariableinject in class GlobalVariablepublic void remove()
BiVariableMap.remove in interface BiVariableremove in class GlobalVariableruntime - environment where a variable is removed.