jruby/docs BETA
Navigation
org.jruby.embed.variable 10
C Argv
I BiVariable
C ClassVariable
C Constant
C GlobalVariable
C InstanceVariable
C LocalGlobalVariable
C PersistentLocalVariable
C TransientLocalVariable
C VariableInterceptor
TransientLocalVariable — members 6+
M get_instance(receiver, name, java_object) BiVariable
C inject()
M is_valid_name(name) boolean
C remove()
C retrieve(receiver, vars)
M type() Type
from AbstractVariable
M is_receiver_identical(receiver) boolean
M java_object() Object
M name() String
M receiver() IRubyObject
M ruby_object() IRubyObject
C ruby_object=(ruby_object)
C set_java_object(runtime, java_object)

org.jruby.embed.variable.TransientLocalVariable

class extends AbstractVariable 6 members

An implementation of BiVariable for a transient local variable. This type of a local variable is available during only one evaluation. After the evaluation, the variable vanishes.

Class Methods

get_instance

BiVariable get_instance ( RubyObject receiver, String name, Object[] java_object )
Java: getInstance(org.jruby.RubyObject receiver, String name, Object[] javaObject)

Returns an instance of this class. This factory method is used when a transient local variable is put in BiVariableMap.

nametypedescription
receiverorg.jruby.RubyObjectreceiver object returned when a script is evaluated.
nameStringa variable name
java_objectObject[]Java object that should be assigned to.

Returns: the instance of TransientLocalVariable

is_valid_name

boolean is_valid_name ( Object name )
Java: isValidName(Object name)

Returns true if the given name is a decent Ruby local variable. Unless returns false.

nametypedescription
nameObjectis a name to be checked.

Returns: true if the given name is of a Ruby local variable.

retrieve

retrieve ( RubyObject receiver, BiVariableMap vars )
Java: retrieve(org.jruby.RubyObject receiver, org.jruby.embed.internal.BiVariableMap vars)

Doesn't do anything since a transient local variable should not be retrieved from Ruby.

nametypedescription
receiverorg.jruby.RubyObjectreceiver object returned when a script is evaluated.
varsorg.jruby.embed.internal.BiVariableMapmap to save retrieved local variables.

Instance Methods

inject

inject ( )
Java: inject()

Injects a local variable value to a parsed Ruby script. This method is invoked during EvalUnit#run() is executed.

remove

remove ( )
Java: remove()

Attempts to remove this variable from top self or receiver.

type

BiVariable.Type type ( )
Java: getType() · also: get_type

Returns enum type of this variable defined in BiVariable.

Returns: this enum type, BiVariable.Type.LocalVariable.

Inherited

from AbstractVariable

is_receiver_identical

boolean is_receiver_identical ( RubyObject receiver )
Java: isReceiverIdentical(org.jruby.RubyObject receiver)

Returns true if a given receiver is identical to the receiver this object has.

Returns: true if identical otherwise false

java_object

Object java_object ( )
Java: getJavaObject() · also: get_java_object

name

String name ( )
Java: getName() · also: get_name

receiver

IRubyObject receiver ( )
Java: getReceiver() · also: get_receiver

ruby_object

IRubyObject ruby_object ( )
Java: getRubyObject() · also: get_ruby_object

ruby_object=

ruby_object= ( IRubyObject ruby_object )
Java: setRubyObject(org.jruby.runtime.builtin.IRubyObject rubyObject) · also: set_ruby_object

set_java_object

set_java_object ( Ruby runtime, Object java_object )
Java: setJavaObject(org.jruby.Ruby runtime, Object javaObject)