| Modifier and Type | Field and Description |
|---|---|
| private static final Set | |
| private static final String[] | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| protected | |
| pack-priv | GlobalVariable(RubyObject receiver, String
the global variable name name, IRubyObject Ruby global object irubyObject)A constructor used when global variables are retrieved from Ruby. |
| Modifier and Type | Method and Description |
|---|---|
| public static BiVariable | Returns: the instance of GlobalVariableReceiver object returned when a script is evaluated. receiver, String a variable name name, Object... Java object that should be assigned to. javaObject)Returns an instance of this class. |
| public BiVariable. | Returns: this enum type, BiVariable.Type.GlobalVariable.Implements org. Returns enum type of this variable defined in |
| public void | inject()
Implements org. A global variable is injected when it is set. |
| protected static boolean | |
| public boolean | Returns: true alwaysOverrides org. Implements org. Returns true if a given receiver is identical to the receiver this object has. |
| public static boolean | Returns: true if the given name is of a Ruby global variable.is a name to be checked. name)Returns true if the given name is a decent Ruby global variable. |
| public void | remove()
Implements org. Attempts to remove this variable from top self or receiver. |
| public static void | retrieve(IRubyObject
receiver object returned when a script is evaluated. receiver, BiVariableMap map to save retrieved global variables. vars)Retrieves global variables from Ruby after the evaluation. |
| public static void | retrieveByKey(Ruby
Ruby runtime runtime, BiVariableMap map to save a retrieved global variable. vars, String name of the global variable key)Retrieves a global variable by key from Ruby after the evaluation. |
| public void | setJavaObject(Ruby
is used to convert a Java object to Ruby object. runtime, Object is a variable value to be set. javaObject)Overrides org. Implements org. Sets a Java object and its Ruby type as a value of this object. |
| public void | |
| public void | tryEagerInjection(final IRubyObject
is the instance that will have variable injection. receiver)Injects a global variable value to a parsed Ruby script. |
| private static void | updateGlobalVar(final BiVariableMap vars, final RubyObject receiver, final String name, final IRubyObject value)
|
| PREDEFINED_NAMES | back to summary |
|---|---|
| private static final Set<String> PREDEFINED_NAMES | |
| PREDEFINED_PATTERNS | back to summary |
|---|---|
| private static final String[] PREDEFINED_PATTERNS | |
| VALID_NAME | back to summary |
|---|---|
| private static final String VALID_NAME | |
| GlobalVariable | back to summary |
|---|---|
| protected GlobalVariable(RubyObject receiver, String name, Object... javaObjects) | |
| GlobalVariable | back to summary |
|---|---|
| pack-priv GlobalVariable(RubyObject receiver, String name, IRubyObject irubyObject) A constructor used when global variables are retrieved from Ruby.
| |
| getInstance | back to summary |
|---|---|
| public static BiVariable getInstance(RubyObject receiver, String name, Object... javaObject) Returns an instance of this class. This factory method is used when a global
variable is put in
| |
| getType | back to summary |
|---|---|
| public BiVariable. Implements org. Returns enum type of this variable defined in
| |
| inject | back to summary |
|---|---|
| public void inject() Implements org. A global variable is injected when it is set. This method does nothing. Instead injection is done by tryEagerInjection.
| |
| isPredefined | back to summary |
|---|---|
| protected static boolean isPredefined(final String name) | |
| isReceiverIdentical | back to summary |
|---|---|
| public boolean isReceiverIdentical(RubyObject recv) Overrides org. Implements org. Returns true if a given receiver is identical to the receiver this object has.
| |
| isValidName | back to summary |
|---|---|
| public static boolean isValidName(Object name) Returns true if the given name is a decent Ruby global variable. Unless returns false.
| |
| remove | back to summary |
|---|---|
| public void remove() Implements org. Attempts to remove this variable from top self or receiver.
| |
| retrieve | back to summary |
|---|---|
| public static void retrieve(IRubyObject receiver, BiVariableMap vars) Retrieves global variables from Ruby after the evaluation.
| |
| retrieveByKey | back to summary |
|---|---|
| public static void retrieveByKey(Ruby runtime, BiVariableMap vars, String key) Retrieves a global variable by key from Ruby after the evaluation.
| |
| setJavaObject | back to summary |
|---|---|
| public void setJavaObject(Ruby runtime, Object javaObject) Overrides org. Implements org. Sets a Java object and its Ruby type as a value of this object. At the same time, sets Ruby object to Ruby runtime. | |
| tryEagerInjection | back to summary |
|---|---|
| public void tryEagerInjection(Ruby runtime, IRubyObject receiver)
Deprecated
| |
| tryEagerInjection | back to summary |
|---|---|
| public void tryEagerInjection(final IRubyObject receiver) Injects a global variable value to a parsed Ruby script. This method is invoked during EvalUnit#run() is executed.
| |
| updateGlobalVar | back to summary |
|---|---|
| private static void updateGlobalVar(final BiVariableMap vars, final RubyObject receiver, final String name, final IRubyObject value) | |