Object is the parent class of all classes in Ruby. Its methods are therefore available to all objects unless explicitly overridden.
| constant | type | note |
|---|---|---|
| NULL_ARRAY | IRubyObject[] |
The id of the object
Returns: the object id
addFinalizer(org.jruby.runtime.builtin.IRubyObject finalizer)addFinalizer(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject finalizer)make this object into a string (hopefully)
Returns: a string value
asJavaString()Convert the object into a symbol name if possible.
Returns: String the symbol name
callMethod(org.jruby.runtime.ThreadContext context, String name)callMethod(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject arg)callMethod(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject[] args)callMethod(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)is this an array if so return it otherwise nil
Returns: nil if type check failed
checkCallMethod(org.jruby.runtime.ThreadContext context, String name)checkCallMethod(org.jruby.runtime.ThreadContext context, org.jruby.runtime.JavaSites.CheckedSites sites)is this a string if so return it otherwise nil
Returns: nil if type check failed
#checkStringType() instead.
is this a string?
Returns: the string if so
isClass() · also: is_classIf 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).
Converts this Ruby object to an Array.
Returns: an array value
Converts this Ruby object to a Float (using to_f).
Returns: a float value
Converts this Ruby object to a Hash.
Returns: a hash value
Converts this Ruby object to an Integer. Uses the default conversion method (to_int).
Returns: an integer value
convertToInteger(String convertMethod)Converts this Ruby object to an Integer.
| name | type | description |
|---|---|---|
| convert_method | String | method to use e.g. to_i |
Returns: an integer value
Converts this Ruby object to a String.
Returns: a string value
copySpecialInstanceVariables(org.jruby.runtime.builtin.IRubyObject clone)dataGetStruct()Our version of Data_Get_Struct. Returns a wrapped data value if there is one, otherwise returns null.
Returns: the object wrapped.
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.
| name | type | description |
|---|---|---|
| obj | Object | the object to wrap |
RubyMethod dup.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
Returns: a dup-ed object
setFrozen(boolean b) · also: set_frozenRubyMethod setFrozen.
| name | type | description |
|---|---|---|
| b | boolean | boolean |
isFrozen() · also: is_frozenRubyMethod isFrozen.
Returns: boolean
getVariable(int index)hasVariables() · also: has_variablesReturns true if object has any variables, defined as:
Returns: true if object has any variables, else false
isImmediate() · also: is_immediateIs this an immediate object
Returns: boolean
inspect(org.jruby.runtime.ThreadContext context)getInstanceVariables() · also: get_instance_variablesgetInternalVariables() · also: get_internal_variablesgetJavaClass() · also: get_java_classRubyMethod getJavaClass.
Returns: Class
marshalLiveVariables(org.jruby.runtime.marshal.MarshalDumper stream, org.jruby.runtime.ThreadContext context, org.jruby.util.io.RubyOutputStream out)getMarshalVariableList() · also: get_marshal_variable_listall marshable values
Returns: a mutable list of all marshalable variables (ivar/internal)
Retrieve self.class.
Returns: the Ruby (meta) class
isModule() · also: is_moduleIf 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).
isNil() · also: is_nilCheck whether this object is nil. MRI: NIL_P macro
Returns: true for nil only
op_eqq(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)op_equal(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)removeFinalizers()respondsTo(String string)RubyMethod respondsTo.
| name | type | description |
|---|---|---|
| string | String | method name |
Returns: boolean
respondsToMissing(String string)RubyMethod respondsTo.
| name | type | description |
|---|---|---|
| string | String | method name |
Returns: boolean
respondsToMissing(String string, boolean priv)RubyMethod respondsTo.
| name | type | description |
|---|---|---|
| string | String | method name |
| priv | boolean | private? |
Returns: boolean
RubyMethod getRuntime.
Returns: the Ruby runtime this belongs to
setVariable(int index, Object value)Retrieve self.singleton_class.
Returns: the Ruby singleton class
singletonClass(org.jruby.runtime.ThreadContext context)isSpecialConst() · also: is_special_constIs this a special constant
Returns: boolean
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).
| name | type | description |
|---|---|---|
| source | org.jruby.runtime.builtin.IRubyObject | the source object containing the variables to sync |
setTaint(boolean taint) · also: set_taintisTaint() · also: is_tainttoJava(Class<T> type)Convert the object to the specified Java class, if possible.
| name | type | description |
|---|---|---|
| type | Class<T> | The target type to which the object should be converted. |
Returns: java type
isTrue() · also: is_trueCheck whether this object is truthy.
Returns: false for nil and false, true otherwise
list of all variables
Returns: a list of all variables (ivar/internal)
getVariableNameList() · also: get_variable_name_listlist of all variable names
Returns: a list of all variable names (ivar/cvar/constant/internal)