jruby/docs BETA
Navigation
org.jruby.runtime.builtin 5
I IRubyObject
I InstanceVariables
I InternalVariables
I RubyJavaObject
I Variable
IRubyObject — members 67
F NULL_ARRAY() IRubyObject[]
M __id__(context) RubyInteger
C add_finalizer(finalizer)
M add_finalizer(context, finalizer) IRubyObject
M any_to_string() IRubyObject
M array(length) IRubyObject[]
M as_java_string() String
M as_string() RubyString
M call_method(context, name) IRubyObject
M call_method(context, name, arg) IRubyObject
M call_method(context, name, args) IRubyObject
M call_method(context, name, args, block) IRubyObject
M check_array_type() IRubyObject
M check_call_method(context, name) IRubyObject
M check_call_method(context, sites) IRubyObject
M check_string_type() IRubyObject
M check_string_type19() IRubyObject
M class?() boolean
M convert_to_array() RubyArray
M convert_to_float() RubyFloat
M convert_to_hash() RubyHash
M convert_to_integer() RubyInteger
M convert_to_integer(convert_method) RubyInteger
M convert_to_string() RubyString
C copy_special_instance_variables(clone)
M data_get_struct() Object
C data_wrap_struct(obj)
M dup() IRubyObject
M dup(context) IRubyObject
M eql(other) boolean
C frozen=(b)
M frozen?() boolean
M get_variable(index) Object
M has_variables?() boolean
M id() IRubyObject
M immediate?() boolean
M infect_by(obj) IRubyObject
M inspect() IRubyObject
M inspect(context) IRubyObject
M instance_variables() InstanceVariables
M internal_variables() InternalVariables
M java_class() Class
C marshal_live_variables(stream, context, out)
M marshal_variable_list() Variable<Object>>
M meta_class() RubyClass
M module?() boolean
M nil?() boolean
M op_eqq(context, other) IRubyObject
M op_equal(context, other) IRubyObject
M rb_clone() IRubyObject
C remove_finalizers()
M responds_to(string) boolean
M responds_to_missing(string) boolean
M responds_to_missing(string, priv) boolean
M runtime() Ruby
C set_variable(index, value)
M singleton_class() RubyClass
M singleton_class(context) RubyClass
M special_const?() boolean
C sync_variables(source)
C taint=(taint)
M taint?() boolean
M to_java(type) T
M true?() boolean
M type() RubyClass
M variable_list() Variable<Object>>
M variable_name_list() List<String>

org.jruby.runtime.builtin.IRubyObject

interface abstract 67 members

Object is the parent class of all classes in Ruby. Its methods are therefore available to all objects unless explicitly overridden.

Constants

constanttypenote
NULL_ARRAY IRubyObject[]

Class Methods

array

IRubyObject[] array ( int length )
Java: array(int length)

Instance Methods

__id__

RubyInteger __id__ ( ThreadContext context )
Java: __id__(org.jruby.runtime.ThreadContext context)

The id of the object

Returns: the object id

add_finalizer

add_finalizer ( IRubyObject finalizer )
Java: addFinalizer(org.jruby.runtime.builtin.IRubyObject finalizer)

add_finalizer

IRubyObject add_finalizer ( ThreadContext context, IRubyObject finalizer )
Java: addFinalizer(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject finalizer)

any_to_string

IRubyObject any_to_string ( )
Java: anyToString()

make this object into a string (hopefully)

Returns: a string value

as_java_string

String as_java_string ( )
Java: asJavaString()

Convert the object into a symbol name if possible.

Returns: String the symbol name

as_string

RubyString as_string ( )
Java: asString()

rb_obj_as_string

Returns: string representation

call_method

IRubyObject call_method ( ThreadContext context, String name )
Java: callMethod(org.jruby.runtime.ThreadContext context, String name)

call_method

IRubyObject call_method ( ThreadContext context, String name, IRubyObject arg )
Java: callMethod(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject arg)

call_method

IRubyObject call_method ( ThreadContext context, String name, IRubyObject[] args )
Java: callMethod(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject[] args)

call_method

IRubyObject call_method ( ThreadContext context, String name, IRubyObject[] args, Block block )
Java: callMethod(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)

check_array_type

IRubyObject check_array_type ( )
Java: checkArrayType()

is this an array if so return it otherwise nil

Returns: nil if type check failed

check_call_method

IRubyObject check_call_method ( ThreadContext context, String name )
Java: checkCallMethod(org.jruby.runtime.ThreadContext context, String name)

check_call_method

IRubyObject check_call_method ( ThreadContext context, JavaSites.CheckedSites sites )
Java: checkCallMethod(org.jruby.runtime.ThreadContext context, org.jruby.runtime.JavaSites.CheckedSites sites)

check_string_type

IRubyObject check_string_type ( )
Java: checkStringType()

is this a string if so return it otherwise nil

Returns: nil if type check failed

check_string_type19

IRubyObject check_string_type19 ( )
Java: checkStringType19()
Deprecated. Use #checkStringType() instead.

is this a string?

Returns: the string if so

class?

boolean class? ( )
Java: isClass() · also: is_class

If is_a? semantics is required, use (someObject instanceof RubyClass/MetaClass) instead.

Returns: true if an object is Ruby Class instance (note that it will return false for Ruby singleton classes).

convert_to_array

RubyArray convert_to_array ( )
Java: convertToArray()

Converts this Ruby object to an Array.

Returns: an array value

convert_to_float

RubyFloat convert_to_float ( )
Java: convertToFloat()

Converts this Ruby object to a Float (using to_f).

Returns: a float value

convert_to_hash

RubyHash convert_to_hash ( )
Java: convertToHash()

Converts this Ruby object to a Hash.

Returns: a hash value

convert_to_integer

RubyInteger convert_to_integer ( )
Java: convertToInteger()

Converts this Ruby object to an Integer. Uses the default conversion method (to_int).

Returns: an integer value

convert_to_integer

RubyInteger convert_to_integer ( String convert_method )
Java: convertToInteger(String convertMethod)

Converts this Ruby object to an Integer.

nametypedescription
convert_methodStringmethod to use e.g. to_i

Returns: an integer value

convert_to_string

RubyString convert_to_string ( )
Java: convertToString()

Converts this Ruby object to a String.

Returns: a string value

copy_special_instance_variables

copy_special_instance_variables ( IRubyObject clone )
Java: copySpecialInstanceVariables(org.jruby.runtime.builtin.IRubyObject clone)

data_get_struct

Object data_get_struct ( )
Java: dataGetStruct()

Our version of Data_Get_Struct. Returns a wrapped data value if there is one, otherwise returns null.

Returns: the object wrapped.

data_wrap_struct

data_wrap_struct ( Object obj )
Java: dataWrapStruct(Object obj)

Our version of Data_Wrap_Struct. This method will just set a private pointer to the object provided. This pointer is transient and will not be accessible from Ruby.

nametypedescription
objObjectthe object to wrap

dup

IRubyObject dup ( )
Java: dup()

RubyMethod dup.

Returns: a dup-ed object

dup

IRubyObject dup ( ThreadContext context )
Java: dup(org.jruby.runtime.ThreadContext context)

RubyMethod dup.

nametypedescription
contextorg.jruby.runtime.ThreadContextthe thread context

Returns: a dup-ed object

eql

boolean eql ( IRubyObject other )
Java: eql(org.jruby.runtime.builtin.IRubyObject other)

frozen=

frozen= ( boolean b )
Java: setFrozen(boolean b) · also: set_frozen

RubyMethod setFrozen.

nametypedescription
bbooleanboolean

frozen?

boolean frozen? ( )
Java: isFrozen() · also: is_frozen

RubyMethod isFrozen.

Returns: boolean

get_variable

Object get_variable ( int index )
Java: getVariable(int index)

has_variables?

boolean has_variables? ( )
Java: hasVariables() · also: has_variables

Returns true if object has any variables, defined as:

  • instance variables
  • class variables
  • constants
  • internal variables, such as those used when marshalling Ranges and Exceptions

Returns: true if object has any variables, else false

id

IRubyObject id ( )
Java: id()

immediate?

boolean immediate? ( )
Java: isImmediate() · also: is_immediate

Is this an immediate object

Returns: boolean

infect_by

IRubyObject infect_by ( IRubyObject obj )
Java: infectBy(org.jruby.runtime.builtin.IRubyObject obj)

inspect

IRubyObject inspect ( )
Java: inspect()

RubyMethod inspect.

Returns: String

inspect

IRubyObject inspect ( ThreadContext context )
Java: inspect(org.jruby.runtime.ThreadContext context)

instance_variables

InstanceVariables instance_variables ( )
Java: getInstanceVariables() · also: get_instance_variables

internal_variables

InternalVariables internal_variables ( )
Java: getInternalVariables() · also: get_internal_variables

java_class

Class java_class ( )
Java: getJavaClass() · also: get_java_class

RubyMethod getJavaClass.

Returns: Class

marshal_live_variables

marshal_live_variables ( MarshalDumper stream, ThreadContext context, RubyOutputStream out )
Java: marshalLiveVariables(org.jruby.runtime.marshal.MarshalDumper stream, org.jruby.runtime.ThreadContext context, org.jruby.util.io.RubyOutputStream out)

marshal_variable_list

List<Variable<Object>> marshal_variable_list ( )
Java: getMarshalVariableList() · also: get_marshal_variable_list

all marshable values

Returns: a mutable list of all marshalable variables (ivar/internal)

meta_class

RubyClass meta_class ( )
Java: getMetaClass() · also: get_meta_class

Retrieve self.class.

Returns: the Ruby (meta) class

module?

boolean module? ( )
Java: isModule() · also: is_module

If is_a? semantics is required, use (someObject instanceof RubyModule) instead.

Returns: true if an object is Ruby Module instance (note that it will return false for Ruby Classes).

nil?

boolean nil? ( )
Java: isNil() · also: is_nil

Check whether this object is nil. MRI: NIL_P macro

Returns: true for nil only

op_eqq

IRubyObject op_eqq ( ThreadContext context, IRubyObject other )
Java: op_eqq(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)

op_equal

IRubyObject op_equal ( ThreadContext context, IRubyObject other )
Java: op_equal(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)

rb_clone

IRubyObject rb_clone ( )
Java: rbClone()

RubyMethod clone.

Returns: a cloned object

remove_finalizers

remove_finalizers ( )
Java: removeFinalizers()

responds_to

boolean responds_to ( String string )
Java: respondsTo(String string)

RubyMethod respondsTo.

nametypedescription
stringStringmethod name

Returns: boolean

responds_to_missing

boolean responds_to_missing ( String string )
Java: respondsToMissing(String string)

RubyMethod respondsTo.

nametypedescription
stringStringmethod name

Returns: boolean

responds_to_missing

boolean responds_to_missing ( String string, boolean priv )
Java: respondsToMissing(String string, boolean priv)

RubyMethod respondsTo.

nametypedescription
stringStringmethod name
privbooleanprivate?

Returns: boolean

runtime

Ruby runtime ( )
Java: getRuntime() · also: get_runtime

RubyMethod getRuntime.

Returns: the Ruby runtime this belongs to

set_variable

set_variable ( int index, Object value )
Java: setVariable(int index, Object value)

singleton_class

RubyClass singleton_class ( )
Java: getSingletonClass() · also: get_singleton_class

Retrieve self.singleton_class.

Returns: the Ruby singleton class

singleton_class

RubyClass singleton_class ( ThreadContext context )
Java: singletonClass(org.jruby.runtime.ThreadContext context)

special_const?

boolean special_const? ( )
Java: isSpecialConst() · also: is_special_const

Is this a special constant

Returns: boolean

sync_variables

sync_variables ( IRubyObject source )
Java: syncVariables(org.jruby.runtime.builtin.IRubyObject source)

Sets object's variables to those in the supplied object, removing/replacing any previously defined variables of the same name. Applies to all variable types (ivar/cvar/constant/internal).

nametypedescription
sourceorg.jruby.runtime.builtin.IRubyObjectthe source object containing the variables to sync

taint=

taint= ( boolean taint )
Java: setTaint(boolean taint) · also: set_taint

taint?

boolean taint? ( )
Java: isTaint() · also: is_taint

to_java

T to_java ( Class<T> type )
Java: toJava(Class<T> type)

Convert the object to the specified Java class, if possible.

nametypedescription
typeClass<T>The target type to which the object should be converted.

Returns: java type

true?

boolean true? ( )
Java: isTrue() · also: is_true

Check whether this object is truthy.

Returns: false for nil and false, true otherwise

type

RubyClass type ( )
Java: getType() · also: get_type

RubyMethod getType.

Returns: RubyClass

variable_list

List<Variable<Object>> variable_list ( )
Java: getVariableList() · also: get_variable_list

list of all variables

Returns: a list of all variables (ivar/internal)

variable_name_list

List<String> variable_name_list ( )
Java: getVariableNameList() · also: get_variable_name_list

list of all variable names

Returns: a list of all variable names (ivar/cvar/constant/internal)