Top Description Methods
org.jruby.runtime.builtin

public Interface InstanceVariables

Known Direct Implementers
org.jruby.BasicObjectStub.DummyInstanceVariables, org.jruby.RubyBasicObject
Imports
java.util.List, java.util.function.BiConsumer, .Consumer

Interface that represents the instance variable aspect of Ruby objects.
Author
headius

Method Summary

Modifier and TypeMethod and Description
public void
copyInstanceVariablesInto(InstanceVariables
the thing to copy into
other
)

Copies all instance variables from the given object into the receiver

public IRubyObject
fastGetInstanceVariable(String internedName)
Deprecated

public boolean
fastHasInstanceVariable(String internedName)
Deprecated

public IRubyObject
fastSetInstanceVariable(String internedName, IRubyObject value)
Deprecated

public default void
forEachInstanceVariable(BiConsumer<String, IRubyObject>
a consumer for each variable
accessor
)

Iterate over all instance variable name/value pairs for this object.

public default void
forEachInstanceVariableName(Consumer<String>
consumer for the names
consumer
)

Iterate over all instance variable names for this object.

public IRubyObject

Returns:

the named instance variable if present, else null
getInstanceVariable
(String
the name of an instance variable
name
)

Returns the named instance variable if present, else null.

public List<Variable<IRubyObject>>

Returns:

instance variables
getInstanceVariableList
()

list of instance variables

public List<String>

Returns:

instance variable names
getInstanceVariableNameList
()

list of instance variables as Strings

public boolean

Returns:

true if object has the named instance variable.
hasInstanceVariable
(String
the name of an instance variable
name
)

Returns true if object has the named instance variable.

public IRubyObject

Returns:

the value of the remove variable, if present; else null
removeInstanceVariable
(String
the name of the variable to remove
name
)

Removes the named instance variable, if present, returning its value.

public IRubyObject

Returns:

value
setInstanceVariable
(String
the name of an instance variable
name
,
IRubyObject
the value to be set
value
)

Sets the named instance variable to the specified value.

Method Detail

copyInstanceVariablesIntoback to summary
public void copyInstanceVariablesInto(InstanceVariables other)

Copies all instance variables from the given object into the receiver

Parameters
other:InstanceVariables

the thing to copy into

fastGetInstanceVariableback to summary
public IRubyObject fastGetInstanceVariable(String internedName)

Deprecated

Annotations
@Deprecated
fastHasInstanceVariableback to summary
public boolean fastHasInstanceVariable(String internedName)

Deprecated

Annotations
@Deprecated
fastSetInstanceVariableback to summary
public IRubyObject fastSetInstanceVariable(String internedName, IRubyObject value)

Deprecated

Annotations
@Deprecated
forEachInstanceVariableback to summary
public default void forEachInstanceVariable(BiConsumer<String, IRubyObject> accessor)

Iterate over all instance variable name/value pairs for this object.

Parameters
accessor:BiConsumer<String, IRubyObject>

a consumer for each variable

forEachInstanceVariableNameback to summary
public default void forEachInstanceVariableName(Consumer<String> consumer)

Iterate over all instance variable names for this object.

Parameters
consumer:Consumer<String>

consumer for the names

getInstanceVariableback to summary
public IRubyObject getInstanceVariable(String name)

Returns the named instance variable if present, else null.

Parameters
name:String

the name of an instance variable

Returns:IRubyObject

the named instance variable if present, else null

getInstanceVariableListback to summary
public List<Variable<IRubyObject>> getInstanceVariableList()

list of instance variables

Returns:List<Variable<IRubyObject>>

instance variables

getInstanceVariableNameListback to summary
public List<String> getInstanceVariableNameList()

list of instance variables as Strings

Returns:List<String>

instance variable names

hasInstanceVariableback to summary
public boolean hasInstanceVariable(String name)

Returns true if object has the named instance variable.

Parameters
name:String

the name of an instance variable

Returns:boolean

true if object has the named instance variable.

removeInstanceVariableback to summary
public IRubyObject removeInstanceVariable(String name)

Removes the named instance variable, if present, returning its value.

Parameters
name:String

the name of the variable to remove

Returns:IRubyObject

the value of the remove variable, if present; else null

setInstanceVariableback to summary
public IRubyObject setInstanceVariable(String name, IRubyObject value)

Sets the named instance variable to the specified value.

Parameters
name:String

the name of an instance variable

value:IRubyObject

the value to be set

Returns:IRubyObject

value