Top Fields Constructors Methods
org.jruby.embed.variable

public Class Argv

extends AbstractVariable
Class Inheritance
Imports
java.util.ArrayList, .Collection, .List, org.jruby.RubyArray, .RubyModule, .RubyNil, .RubyObject, org.jruby.embed.internal.BiVariableMap, org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject

Field Summary

Modifier and TypeField and Description
private static final String
Inherited from org.jruby.embed.variable.AbstractVariable:
fromRubyjavaObjectjavaTypenamereceiverrubyObject

Constructor Summary

AccessConstructor and Description
private
Argv(RubyObject receiver, String name, Object... javaObjects)

pack-priv
Argv(RubyObject
a receiver object that this variable/constant is originally in. When the variable/constant is originated from Ruby, receiver may not be null.
receiver
,
String
the constant name
name
,
IRubyObject
Ruby constant object
irubyObject
)

A constructor used when ARGV is retrieved from Ruby.

Method Summary

Modifier and TypeMethod and Description
public static BiVariable

Returns:

the instance of Constant
getInstance
(RubyObject
Receiver 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 synchronized Object
getJavaObject()

Overrides org.jruby.embed.variable.AbstractVariable.getJavaObject.

Implements org.jruby.embed.variable.BiVariable.getJavaObject.

Returns a value of the variable this object holds in Java type.

public BiVariable.Type

Returns:

this enum type, BiVariable.Type.InstanceVariable.
getType
()

Implements org.jruby.embed.variable.BiVariable.getType.

Returns enum type of this variable defined in BiVariable.

public synchronized void
inject()

Implements org.jruby.embed.variable.BiVariable.inject.

Injects ARGV values to a parsed Ruby script.

public static boolean

Returns:

true if the given name is ARGV.
isValidName
(Object
is a name to be checked.
name
)

Returns true if the given name is ARGV.

public synchronized void
remove()

Implements org.jruby.embed.variable.BiVariable.remove.

Removes this object from BiVariableMap.

public static void
retrieve(final RubyObject
receiver object returned when a script is evaluated.
receiver
,
final BiVariableMap
map to save retrieved constants.
vars
)

Retrieves ARGV from Ruby after the evaluation or method invocation.

public static void
retrieveByKey(RubyObject
receiver object returned when a script is evaluated.
receiver
,
BiVariableMap
map to save retrieved instance variables.
vars
,
String
instace varible name
key
)

Retrieves ARGV by key from Ruby runtime after the evaluation.

private static void
updateARGV(ThreadContext context, IRubyObject receiver, final BiVariableMap vars)

protected synchronized void
Inherited from org.jruby.embed.variable.AbstractVariable:
getCurrentContextgetNamegetReceivergetRubyClassgetRubyObjectgetRuntimegetTopSelfgetTopSelfisReceiverIdenticalisValidNamesetJavaObjectsetRubyObjectupdateByJavaObject

Field Detail

VALID_NAMEback to summary
private static final String VALID_NAME

Constructor Detail

Argvback to summary
private Argv(RubyObject receiver, String name, Object... javaObjects)
Argvback to summary
pack-priv Argv(RubyObject receiver, String name, IRubyObject irubyObject)

A constructor used when ARGV is retrieved from Ruby.

Parameters
receiver:RubyObject

a receiver object that this variable/constant is originally in. When the variable/constant is originated from Ruby, receiver may not be null.

name:String

the constant name

irubyObject:IRubyObject

Ruby constant object

Method Detail

getInstanceback to summary
public static BiVariable getInstance(RubyObject receiver, String name, Object... javaObject)

Returns an instance of this class. This factory method is used when an ARGV is put in BiVariableMap.

Parameters
receiver:RubyObject

Receiver object returned when a script is evaluated.

name:String

a variable name

javaObject:Object[]

Java object that should be assigned to.

Returns:BiVariable

the instance of Constant

getJavaObjectback to summary
public synchronized Object getJavaObject()

Overrides org.jruby.embed.variable.AbstractVariable.getJavaObject.

Implements org.jruby.embed.variable.BiVariable.getJavaObject.

Doc from org.jruby.embed.variable.BiVariable.getJavaObject.

Returns a value of the variable this object holds in Java type.

Returns:Object

a value in Java type.

Annotations
@Override
@SuppressWarnings:unchecked
getTypeback to summary
public BiVariable.Type getType()

Implements org.jruby.embed.variable.BiVariable.getType.

Returns enum type of this variable defined in BiVariable.

Returns:BiVariable.Type

this enum type, BiVariable.Type.InstanceVariable.

Annotations
@Override
injectback to summary
public synchronized void inject()

Implements org.jruby.embed.variable.BiVariable.inject.

Injects ARGV values to a parsed Ruby script. This method is invoked during EvalUnit#run() is executed.

Annotations
@Override
isValidNameback to summary
public static boolean isValidName(Object name)

Returns true if the given name is ARGV. Unless returns false.

Parameters
name:Object

is a name to be checked.

Returns:boolean

true if the given name is ARGV.

removeback to summary
public synchronized void remove()

Implements org.jruby.embed.variable.BiVariable.remove.

Removes this object from BiVariableMap. Also, initialize this variable in top self.

Annotations
@Override
retrieveback to summary
public static void retrieve(final RubyObject receiver, final BiVariableMap vars)

Retrieves ARGV from Ruby after the evaluation or method invocation.

Parameters
receiver:RubyObject

receiver object returned when a script is evaluated.

vars:BiVariableMap

map to save retrieved constants.

retrieveByKeyback to summary
public static void retrieveByKey(RubyObject receiver, BiVariableMap vars, String key)

Retrieves ARGV by key from Ruby runtime after the evaluation. This method is used when eager retrieval is off.

Parameters
receiver:RubyObject

receiver object returned when a script is evaluated.

vars:BiVariableMap

map to save retrieved instance variables.

key:String

instace varible name

updateARGVback to summary
private static void updateARGV(ThreadContext context, IRubyObject receiver, final BiVariableMap vars)
updateRubyObjectback to summary
protected synchronized void updateRubyObject(final IRubyObject rubyObject)

Overrides org.jruby.embed.variable.AbstractVariable.updateRubyObject.