public interface BiVariable
BiVariableMap
after a variable is set to the map. Users can set variables
in Java program explicitly through put() methods in ScriptingContainer
and BiVariableMap
or equivalents. However, variables in Ruby scripts are
set in the map implicitly. When variables and constants
are used in the script, those are automatically saved in the map converting to this type.Modifier and Type | Interface and Description |
---|---|
static class |
BiVariable.Type
Defines a type correspond to Ruby's variables and constant types.
|
Modifier and Type | Method and Description |
---|---|
Object |
getJavaObject()
Returns a value of the variable this object holds in Java type.
|
String |
getName()
Returns a name of the variable this object holds.
|
IRubyObject |
getReceiver()
Returns the original receiver where this variable has been retrieved.
|
IRubyObject |
getRubyObject()
Returns a value of the variable this object holds in
a org.jruby.runtime.builtin.IRubyObject type.
|
BiVariable.Type |
getType()
Returns one of the Ruby's variables or constant types defined by Type.
|
void |
inject()
Injects a variable value to a parsed Ruby script.
|
boolean |
isReceiverIdentical(RubyObject receiver)
Returns true if a given receiver is identical to the receiver this object has.
|
void |
remove()
Attempts to remove this variable/constant from top self or receiver.
|
void |
setJavaObject(Ruby runtime,
Object javaObject)
Sets a Java object as a value of this object.
|
void |
setRubyObject(IRubyObject rubyObject)
Sets a org.jruby.runtime.builtin.IRubyObject type, Ruby object as a value
of this object.
|
BiVariable.Type getType()
IRubyObject getReceiver()
boolean isReceiverIdentical(RubyObject receiver)
String getName()
Object getJavaObject()
void setJavaObject(Ruby runtime, Object javaObject)
runtime
- is used to convert a Java object to Ruby object.javaObject
- is a variable value to be set.void inject()
IRubyObject getRubyObject()
void setRubyObject(IRubyObject rubyObject)
runtime
- is environment where a variable injection occursrubyObject
- is a variable value to be set.void remove()
Copyright © 2001-2016 JRuby. All Rights Reserved.