| constant | type | note |
|---|---|---|
| CLASS_ALLOCATOR | ObjectAllocator | |
| CS_IDX_INITIALIZE | int |
checkInheritable(org.jruby.runtime.builtin.IRubyObject superClass)rb_check_inheritable
checkInheritable(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject superClass)createBootstrapClass(org.jruby.Ruby runtime, String name, org.jruby.RubyClass superClass, org.jruby.runtime.ObjectAllocator allocator)boot_defclass Create an initial Object meta class before Module and Kernel dependencies have squirreled themselves together.
| name | type | description |
|---|---|---|
| runtime | org.jruby.Ruby | we need it |
Returns: a half-baked meta class for object
finishCreateClassClass(org.jruby.runtime.ThreadContext context, org.jruby.RubyClass Class)marshalTo(org.jruby.RubyClass clazz, org.jruby.runtime.marshal.MarshalStream output)marshalTo(org.jruby.runtime.ThreadContext context, org.jruby.util.io.RubyOutputStream out, org.jruby.RubyClass clazz, org.jruby.runtime.marshal.MarshalDumper output)nearestReifiedClass(org.jruby.RubyClass klass)newClass(org.jruby.Ruby runtime, org.jruby.RubyClass superClass)Construct a new class with the given name scoped under Object (global) and with Object as its immediate superclass. Corresponds to rb_class_new in MRI.
newClass(org.jruby.runtime.ThreadContext context, org.jruby.RubyClass superClass, org.jruby.runtime.CallSite[] extraCallSites)A variation on newClass that allow passing in an array of supplementary call sites to improve dynamic invocation.
newClass(org.jruby.Ruby runtime, org.jruby.RubyClass superClass, String name, org.jruby.runtime.ObjectAllocator allocator, org.jruby.RubyModule parent, boolean setParent)Construct a new class with the given name, allocator, parent class, and containing class. If setParent is true, the class's parent will be explicitly set to the provided parent (rather than the new class just being assigned to a constant in that parent). Corresponds to rb_class_new/rb_define_class_id/rb_name_class/rb_set_class_path in MRI.
newClass(org.jruby.Ruby runtime, org.jruby.RubyClass superClass, String name, org.jruby.runtime.ObjectAllocator allocator, org.jruby.RubyModule parent, boolean setParent, String file, int line)newClass(org.jruby.runtime.ThreadContext context, org.jruby.RubyClass superClass, String name, org.jruby.runtime.ObjectAllocator allocator, org.jruby.RubyModule parent, boolean setParent, String file, int line)newClass(org.jruby.Ruby runtime, org.jruby.RubyClass superClass, String name, org.jruby.runtime.ObjectAllocator allocator, org.jruby.RubyModule parent, boolean setParent, org.jruby.runtime.CallSite[] extraCallSites)newClass(org.jruby.runtime.ThreadContext context, org.jruby.RubyClass superClass, String name, org.jruby.runtime.ObjectAllocator allocator, org.jruby.RubyModule parent, boolean setParent, org.jruby.runtime.CallSite[] extraCallSites)A variation on newClass that allows passing in an array of supplementary call sites to improve dynamic invocation performance.
newClassBootstrap(org.jruby.Ruby runtime, org.jruby.RubyClass Object, org.jruby.RubyClass Class, String name)This is an internal API for bootstrapping a few classes before ThreadContext is available. The API is intentionally limited/obtuse so no one is tempted to try and use it.
| name | type | description |
|---|---|---|
| runtime | org.jruby.Ruby | the runtime |
| object | org.jruby.RubyClass | reference to Object which is superclass and parent for new type |
| name | String | the name of the new class |
Returns: the new class.
unmarshalFrom(org.jruby.runtime.marshal.UnmarshalStream input)unmarshalFrom(org.jruby.runtime.ThreadContext context, org.jruby.util.io.RubyInputStream in, org.jruby.runtime.marshal.MarshalLoader input)addClassAnnotation(Class<?> annotation, Map fields)addFieldAnnotation(String fieldName, Class<?> annotation, Map fields)addFieldSignature(String fieldName, Class<?> type)addMethodAnnotation(String methodName, Class<?> annotation, Map fields)addMethodSignature(String methodName, Class<?>[] types)addParameterAnnotation(String method, int i, Class<?> annoClass, Map<String,Object> value)Add a new subclass to the weak set of subclasses. This version always constructs a new set to avoid having to synchronize against the set when iterating it for invalidation in invalidateCacheDescendants.
| name | type | description |
|---|---|---|
| subclass | org.jruby.RubyClass | The subclass to add |
getAllMethodSignatures() · also: get_all_method_signaturesallocate(org.jruby.runtime.ThreadContext context)allocator(org.jruby.runtime.ObjectAllocator allocator)Define an allocator for this class (usually this is part of
org.jruby.api.Define#defineClass(ThreadContext, String, RubyClass, ObjectAllocator)).
| name | type | description |
|---|---|---|
| allocator | org.jruby.runtime.ObjectAllocator | to use |
Returns: itself for a composable API
setAllocator(org.jruby.runtime.ObjectAllocator allocator) · also: set_allocatororg.jruby.RubyClass#allocator(ObjectAllocator) instead.
attached_object(org.jruby.runtime.ThreadContext context)becomeSynchronized()make this class and all subclasses sync
checkMethodBasicDefinition(String name)isClass() · also: is_classsetClassAllocator(Class<?> clazz) · also: set_class_allocatorSet a reflective allocator that calls a no-arg constructor on the given class.
| name | type | description |
|---|---|---|
| clazz | Class<?> | The class on which to call the default constructor to allocate |
getClassAnnotations() · also: get_class_annotationssetClassConfig(org.jruby.javasupport.util.JavaClassConfiguration jcc) · also: set_class_configgetFFIHandleAccessorField() · also: get_ffi_handle_accessor_fieldgetFFIHandleAccessorForRead() · also: get_ffi_handle_accessor_for_readgetFFIHandleAccessorForWrite() · also: get_ffi_handle_accessor_for_writegetFieldAnnotations() · also: get_field_annotationsgetFieldSignatures() · also: get_field_signaturesfinvoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.Block block)finvoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)finvoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)finvoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)finvoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)finvoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name)finvoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject[] args)finvoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg)finvoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1)finvoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2)finvokeChecked(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name)Safely attempt to invoke the given method name on self, using respond_to? and method_missing as appropriate. Return null if the method does not exist. MRI: rb_check_funcall
finvokeChecked(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, org.jruby.runtime.JavaSites.CheckedSites sites)Safely attempt to invoke the given method name on self, using respond_to? and method_missing as appropriate. Return null if the method does not exist. MRI: rb_check_funcall
finvokeChecked(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject[] args)Safely attempt to invoke the given method name on self, using respond_to? and method_missing as appropriate. Return null if the method does not exist. MRI: rb_check_funcall
finvokeChecked(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, org.jruby.runtime.JavaSites.CheckedSites sites, org.jruby.runtime.builtin.IRubyObject[] args)Safely attempt to invoke the given method name on self, using respond_to? and method_missing as appropriate. Return null if the method does not exist. MRI: rb_check_funcall
finvokeWithRefinements(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, org.jruby.parser.StaticScope staticScope, String name, org.jruby.runtime.Block block)finvokeWithRefinements(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, org.jruby.parser.StaticScope staticScope, String name, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)finvokeWithRefinements(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, org.jruby.parser.StaticScope staticScope, String name, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)finvokeWithRefinements(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, org.jruby.parser.StaticScope staticScope, String name, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)finvokeWithRefinements(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, org.jruby.parser.StaticScope staticScope, String name, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)getPositionOrDefault(org.jruby.internal.runtime.methods.DynamicMethod method)getVariableAccessorForRead(String name)getVariableAccessorForWrite(String name)hasObjectID() · also: has_object_idrb_class_inherited (reversed semantics!)
inherited(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)initialize(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_class_initialize
initialize(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject superObject, org.jruby.runtime.Block block)initializeCopiedModule(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject original)Class-specific logic for RubyModule#initializeCopiedModule(ThreadContext, IRubyObject)
invalidateCacheDescendants(org.jruby.runtime.ThreadContext context)Invalidate all subclasses of this class by walking the set of all subclasses and asking them to invalidate themselves. Note that this version works against a reference to the current set of subclasses, which could be replaced by the time this iteration is complete. In theory, there may be a path by which invalidation would miss a class added during the invalidation process, but the exposure is minimal if it exists at all. The only way to prevent it would be to synchronize both invalidation and subclass set modification against a global lock, which we would like to avoid.
invoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.CallType callType, org.jruby.runtime.Block block)This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134
invoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.CallType callType, org.jruby.runtime.Block block)This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134
invoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.CallType callType, org.jruby.runtime.Block block)This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134
invoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.CallType callType, org.jruby.runtime.Block block)This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134
invoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.CallType callType, org.jruby.runtime.Block block)This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134
invoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.CallType callType)This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134
invoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.CallType callType)This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134
invoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.CallType callType)This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134
invoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.CallType callType)This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134
invoke(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.CallType callType)This method is deprecated because it depends on having a Ruby frame pushed for checking method visibility, and there's no way to enforce that. Most users of this method probably don't need to check visibility. See https://github.com/jruby/jruby/issues/4134
invokeInherited(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, org.jruby.runtime.builtin.IRubyObject subclass)invokePublic(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject self, String name, org.jruby.runtime.builtin.IRubyObject arg)MRI: rb_funcallv_public
isReifiable(boolean[] java)Whether this class can be reified into a Java class. Currently only objects that descend from Object (or descend from Ruby-based classes that descend from Object) can be reified.
| name | type | description |
|---|---|---|
| java | boolean[] | If reified from java (out param) |
Returns: true if the class can be reified, false otherwise. The out param indicate if it is java concrete reification
getIsReifiedExtendedJavaClass() · also: get_is_reified_extended_java_classIf the current class is reified (null otherwise) and if it extends java
Returns: Null if not reified, true if a concrete extension class, and false if a ruby class
marshal(Object obj, org.jruby.runtime.marshal.MarshalStream marshalStream)marshal(org.jruby.runtime.ThreadContext context, org.jruby.util.io.RubyOutputStream out, Object obj, org.jruby.runtime.marshal.MarshalDumper marshalStream)setMarshal(org.jruby.runtime.ObjectMarshal marshal) · also: set_marshalorg.jruby.RubyClass#marshalWith(ObjectMarshal) instead.
Set what marshaller we use or generally use this to specify the typw cannot Marshal data.
| name | type | description |
|---|---|---|
| marshal | org.jruby.runtime.ObjectMarshal | the marshaller |
Returns: itself for composable API
getMethodAnnotations() · also: get_method_annotationsgetMethodSignatures() · also: get_method_signaturesisModule() · also: is_modulenewInstance(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_class_new_instance
newInstance(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)newInstance(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0)newInstance(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)newInstance(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)newInstance(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)getObjectGroupAccessorField() · also: get_object_group_accessor_fieldgetObjectGroupAccessorForRead() · also: get_object_group_accessor_for_readgetObjectGroupAccessorForWrite() · also: get_object_group_accessor_for_writegetObjectIdAccessorField() · also: get_object_id_accessor_fieldgetParameterAnnotations() · also: get_parameter_annotationsGet the "real" class, either the current one or the nearest ancestor that is not a singleton or include wrapper.
Returns: the nearest non-singleton non-include class
Equivalent to #getRealClass().
Returns: the nearest non-singleton non-include class
reifiedClass(Class<? extends org.jruby.runtime.builtin.IRubyObject> reifiedClass)Sets reified class to use.
| name | type | description |
|---|---|---|
| reified_class | Class<? extends org.jruby.runtime.builtin.IRubyObject> | the java type to use |
Returns: itself for composable API
RubyClass#reifiedClass() instead.
Gets a reified Ruby or Java class.
To ensure a specific type, see #getReifiedRubyClass() or #getReifiedJavaClass()
setReifiedClass(Class<? extends org.jruby.runtime.builtin.IRubyObject> reifiedClass) · also: set_reified_classorg.jruby.RubyClass#reifiedClass(Class) instead.
getReifiedJavaClass() · also: get_reified_java_classGets a reified Java class. Throws if this is a Ruby class
getReifiedRubyClass() · also: get_reified_ruby_classGets a reified Ruby class. Throws if this is a Java class
reify()reify(String classDumpDir)reify(boolean useChildLoader)reify(String classDumpDir, boolean useChildLoader)Stand up a real Java class for the backing store of this object
| name | type | description |
|---|---|---|
| class_dump_dir | String | Directory to save reified java class |
reifyWithAncestors()reifyWithAncestors(String classDumpDir)reifyWithAncestors(boolean useChildLoader)reifyWithAncestors(String classDumpDir, boolean useChildLoader)Reify this class, first reifying all its ancestors. This causes the reified class and all ancestors' reified classes to come into existence, so any future changes will not be reflected. This form also accepts a string argument indicating a path in which to dump the intermediate reified class bytes.
| name | type | description |
|---|---|---|
| class_dump_dir | String | the path in which to dump reified class bytes |
| use_child_loader | boolean | whether to load the class into its own child classloader |
Remove a subclass from the weak set of subclasses.
| name | type | description |
|---|---|---|
| subclass | org.jruby.RubyClass | The subclass to remove |
replaceSubclass(org.jruby.RubyClass subclass, org.jruby.RubyClass newSubclass)Replace an existing subclass with a new one.
| name | type | description |
|---|---|---|
| subclass | org.jruby.RubyClass | The subclass to remove |
| new_subclass | org.jruby.RubyClass | The subclass to replace it with |
setRubyClassAllocator(Class<? extends org.jruby.runtime.builtin.IRubyObject> clazz) · also: set_ruby_class_allocatorSet a reflective allocator that calls the "standard" Ruby object constructor (Ruby, RubyClass) on the given class.
| name | type | description |
|---|---|---|
| clazz | Class<? extends org.jruby.runtime.builtin.IRubyObject> | The class from which to grab a standard Ruby constructor |
setRubyStaticAllocator(Class<?> clazz) · also: set_ruby_static_allocatorSet a reflective allocator that calls the "standard" Ruby object constructor (Ruby, RubyClass) on the given class via a static __allocate__ method intermediate.
| name | type | description |
|---|---|---|
| clazz | Class<?> | The class from which to grab a standard Ruby __allocate__ method.
Note: Used with `jrubyc --java` generated (interoperability) class files. Note: Used with new concrete extension. |
isSingleton() · also: is_singletonsmartDump(org.jruby.runtime.marshal.MarshalStream stream, org.jruby.runtime.builtin.IRubyObject target)Marshal the given object to the marshaling stream, being "smart" and caching how to do that marshaling. If the class defines a custom "respond_to?" method, then the behavior of dumping could vary without our class structure knowing it. As a result, we do only the slow-path classic behavior. If the class defines a real "marshal_dump" method, we cache and use that. If the class defines a real "_dump" method, we cache and use that. If the class neither defines none of the above methods, we use a fast path directly to the default dumping logic.
| name | type | description |
|---|---|---|
| stream | org.jruby.runtime.marshal.MarshalStream | The stream to which to marshal the data |
| target | org.jruby.runtime.builtin.IRubyObject | The object whose data should be marshaled |
| IOException | If there is an IO exception while writing to the stream. | |
smartDump(org.jruby.runtime.ThreadContext context, org.jruby.util.io.RubyOutputStream out, org.jruby.runtime.marshal.MarshalDumper stream, org.jruby.runtime.builtin.IRubyObject target)smartLoadNewUser(org.jruby.runtime.builtin.IRubyObject target, org.jruby.runtime.builtin.IRubyObject data)Load marshaled data into a blank target object using marshal_load, being "smart" and caching the mechanism for invoking marshal_load. If the class implements a custom respond_to?, cache nothing and go slow path invocation of respond_to? and marshal_load every time. Raise error if respond_to? :marshal_load returns true and no :marshal_load is defined. If the class implements marshal_load, cache and use that. Otherwise, error, since marshal_load is not present.
| name | type | description |
|---|---|---|
| target | org.jruby.runtime.builtin.IRubyObject | The blank target object into which marshal_load will deserialize the given data |
| data | org.jruby.runtime.builtin.IRubyObject | The marshaled data |
Returns: The fully-populated target object
smartLoadOldUser(org.jruby.runtime.builtin.IRubyObject data)Load marshaled data into a blank target object using _load, being "smart" and caching the mechanism for invoking _load. If the metaclass implements custom respond_to?, cache nothing and go slow path invocation of respond_to? and _load every time. Raise error if respond_to? :_load returns true and no :_load is defined. If the metaclass implements _load, cache and use that. Otherwise, error, since _load is not present.
| name | type | description |
|---|---|---|
| data | org.jruby.runtime.builtin.IRubyObject | The marshaled data, to be reconstituted into an object by _load |
Returns: The fully-populated target object
subclasses(org.jruby.runtime.ThreadContext context)subclasses(boolean includeDescendants)getSubclassesForRead() · also: get_subclasses_for_readsuperclass(org.jruby.runtime.ThreadContext context)Return the real super class of this class. rb_class_superclass
toJava(Class<T> target)unmarshal(org.jruby.runtime.marshal.UnmarshalStream unmarshalStream)unmarshal(org.jruby.runtime.ThreadContext context, org.jruby.util.io.RubyInputStream in, org.jruby.runtime.marshal.MarshalLoader loader)getVariableAccessorsForRead() · also: get_variable_accessors_for_readgetVariableNames() · also: get_variable_namesGet an array of all the known instance variable names. The offset into the array indicates the offset of the variable's value in the per-object variable array.
Returns: a copy of the array of known instance variable names
getVariableTableCopy() · also: get_variable_table_copygetVariableTableManager() · also: get_variable_table_managergetVariableTableSize() · also: get_variable_table_sizegetVariableTableSizeWithExtras() · also: get_variable_table_size_with_extras| field | type | note |
|---|---|---|
| NULL_ARRAY | IRubyObject[] |
#checkStringType() instead.
is this a string?
Returns: the string if so
RubyMethod dup.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
Returns: a dup-ed object
marshalLiveVariables(org.jruby.runtime.marshal.MarshalDumper stream, org.jruby.runtime.ThreadContext context, org.jruby.util.io.RubyOutputStream out)| field | type | note |
|---|---|---|
| ALL_F | int | |
| BASICOBJECT_ALLOCATOR | ObjectAllocator | Default allocator instance for all Ruby objects. The only reason to not use this allocator is if you actually need to have all instances of something be a subclass of RubyObject. |
| ERR_INSECURE_SET_INST_VAR | String | The error message used when some one tries to modify an instance variable in a high security setting. |
| FALSE_F | int | |
| FROZEN_F | int | |
| NEVER | IRubyObject | A value that is used as a null sentinel in among other places the RubyArray implementation. It will cause large problems to call any methods on this object. |
| NIL_F | int | This flag is a bit funny. It's used to denote that this value
is nil. It's a bit counterintuitive for a Java programmer to
not use subclassing to handle this case, since we have a
RubyNil subclass anyway. Well, the reason for it being a flag
is that the #isNil() method is called extremely often. So often
that it gives a good speed boost to make it monomorphic and
final. It turns out using a flag for this actually gives us
better performance than having a polymorphic #isNil() method. |
| STAMP_OFFSET | long | |
| TAINTED_F | int | |
| UNDEF | IRubyObject | A value that specifies an undefined value. This value is used as a sentinel for undefined constant values, and other places where neither null nor NEVER makes sense. |
| VAR_TABLE_OFFSET | long | |
| varTable | Object[] | variable table, lazily allocated as needed (if needed) |
| varTableStamp | byte | locking stamp for Unsafe ops updating the vartable |
rb_obj_id Return the internal id of an object.
addFinalizer(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject f)Adds the specified object as a finalizer for this object.
Internal method that helps to convert any object into the format of a class name and a hex string inside of #<>.
asJavaString()rb_to_id Will try to convert this object to a String using the Ruby "to_str" if the object isn't already a String. If this still doesn't work, will throw a Ruby TypeError.
Returns: a (Java) string
rb_obj_as_string
First converts this object into a String using the "to_s"
method and returns it. If
to_s doesn't return a Ruby String, Convert#anyToString is used
instead.
callMethod(org.jruby.runtime.ThreadContext context, String name)Will invoke a named method with no arguments and no block.
callMethod(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject arg)Will invoke a named method with one argument and no block with functional invocation.
callMethod(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject[] args)Will invoke a named method with the supplied arguments and no block with functional invocation.
callMethod(String name, org.jruby.runtime.builtin.IRubyObject[] args)callMethod(String name, org.jruby.runtime.builtin.IRubyObject arg)callMethod(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)Will invoke a named method with the supplied arguments and supplied block with functional invocation.
rb_check_array_type Returns the result of trying to convert this object to an Array with "to_ary".
checkCallMethod(org.jruby.runtime.ThreadContext context, String name)Will invoke a named method with no arguments and no block if that method or a custom method missing exists. Otherwise returns null. 1.9: rb_check_funcall
checkCallMethod(org.jruby.runtime.ThreadContext context, org.jruby.runtime.JavaSites.CheckedSites sites)Will invoke a named method with no arguments and no block if that method or a custom method missing exists. Otherwise returns null. 1.9: rb_check_funcall
rb_check_string_type Tries to return a coerced string representation of this object, using "to_str". If that returns something other than a String or nil, an empty String will be returned.
Compares this Ruby object with another.
| name | type | description |
|---|---|---|
| other | org.jruby.runtime.builtin.IRubyObject | another IRubyObject |
Returns: 0 if equal, < 0 if this is less than other, > 0 if this is greater than other
Tries to convert this object to a Ruby Array using the "to_ary" method.
Returns: array representation of this
Tries to convert this object to a Ruby Float using the "to_f" method.
Returns: float representation of this
Tries to convert this object to a Ruby Hash using the "to_hash" method.
Returns: hash representation of this
Tries to convert this object to a Ruby Integer using the "to_int" method.
Returns: an integer representation of this
convertToInteger(String convertMethod)Tries to convert this object to a Ruby Integer using the supplied conversion method.
| name | type | description |
|---|---|---|
| convert_method | String | conversion method to use e.g. "to_i" |
Returns: an integer representation of this
Tries to convert this object to a Ruby String using the "to_str" method.
Returns: a string representation of this
copyInstanceVariablesInto(org.jruby.runtime.builtin.InstanceVariables other)copySpecialInstanceVariables(org.jruby.runtime.builtin.IRubyObject clone)Lots of MRI objects keep their state in non-lookupable ivars (e:g. Range, Struct, etc). This method is responsible for dupping our java field equivalents
dataGetStruct()dataWrapStruct(Object obj)raw (id) strings are not properly encoded but in an iso_8859_1 form. This method will lookup properly encoded string from the symbol table.
| name | type | description |
|---|---|---|
| id | String | the id of the string |
Returns: the string of the symbol found from id
display(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)ensureInstanceVariablesSettable()Makes sure that instance variables can be set on this object, including information about whether this object is frozen. Will throw a suitable exception in that case.
method used for Hash key comparison (specialized for String, Symbol and Fixnum)
Returns: Will by default just call the Ruby method "eql?"
eql_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)equal_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)rb_obj_equal Will use Java identity equality.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| other | org.jruby.runtime.builtin.IRubyObject | to compare with |
Returns: are they equal?
evalUnder(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule under, org.jruby.RubyString src, String file, int line, org.jruby.EvalType evalType)extend(org.jruby.runtime.builtin.IRubyObject[] args)rb_obj_extend call-seq: obj.extend(module, ...) => obj Adds to _obj_ the instance methods from each module given as a parameter. module Mod def hello "Hello from Mod.\n" end end class Klass def hello "Hello from Klass.\n" end end k = Klass.new k.hello #=> "Hello from Klass.\n" k.extend(Mod) #=> #<Klass:0x401b3bc8> k.hello #=> "Hello from Mod.\n"
| name | type | description |
|---|---|---|
| args | org.jruby.runtime.builtin.IRubyObject[] | to use as modules to extend |
Returns: itself
isFalse() · also: is_falseIs this value a falsey value or not?
Returns: true if falsey
getFFIHandle() · also: get_ffi_handlesetFFIHandle(Object value) · also: set_ffi_handleforEachInstanceVariable(java.util.function.BiConsumer<String,org.jruby.runtime.builtin.IRubyObject> accessor)forEachInstanceVariableName(java.util.function.Consumer<String> consumer)setFrozen(boolean frozen) · also: set_frozenSets whether this object is frozen or not.
| name | type | description |
|---|---|---|
| frozen | boolean | should this object be frozen? |
isFrozen() · also: is_frozenIs this value frozen or not?
Returns: true if this object is frozen, false otherwise
frozen_p(org.jruby.runtime.ThreadContext context)getFlag(int flag)getInternalVariable(String name)getVariable(int index)hasInstanceVariable(String name)hasInternalVariable(String name)hasVariables() · also: has_variablesReturns true if object has any variables
RubyBasicObject#hash(ThreadContext) instead.
Will return the hash code of this object. In comparison to MRI, this method will use the Java identity hash code instead of using rb_obj_id, since the usage of id in JRuby will incur the cost of some. ObjectSpace maintenance.
Returns: hash value
hashyInspect(org.jruby.runtime.ThreadContext context)isImmediate() · also: is_immediateIs object immediate (def: Fixnum, Symbol, true, false, nil?).
initialize(org.jruby.runtime.ThreadContext context)initialize_copy(org.jruby.runtime.builtin.IRubyObject original)org.jruby.RubyBasicObject#initialize_copy(ThreadContext, IRubyObject) instead.
| name | type | description |
|---|---|---|
| original | org.jruby.runtime.builtin.IRubyObject | object |
Returns: a copy
initialize_copy(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject original)Initializes this object as a copy of the original, that is the parameter to this object. Will make sure that the argument actually has the same real class as this object. It shouldn't be possible to initialize an object with something totally different.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| original | org.jruby.runtime.builtin.IRubyObject | the original |
Returns: a copy unless the same thing
inspect(org.jruby.runtime.ThreadContext context)Returns a string containing a human-readable representation of
obj. If not overridden, uses the to_s method to
generate the string.
[ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]"
Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"
instance_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)instance_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)instance_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)instance_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)instance_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)instance_exec(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)rb_obj_instance_exec call-seq: obj.instance_exec(arg...) {|var...| block } => obj Executes the given block within the context of the receiver (_obj_). In order to set the context, the variable +self+ is set to _obj_ while the code is executing, giving the code access to _obj_'s instance variables. Arguments are passed as block parameters. class Klass def initialize @secret = 99 end end k = Klass.new k.instance_exec(5) {|x| @secret+x } #=> 104
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| args | org.jruby.runtime.builtin.IRubyObject[] | the args |
| block | org.jruby.runtime.Block | block |
Returns: the result
instance_of_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject type)rb_obj_is_instance_of
call-seq:
obj.instance_of?(class) => true or false
Returns true if obj is an instance of the given
class. See also Object#kind_of?.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| type | org.jruby.runtime.builtin.IRubyObject | the type |
Returns: true if this is instance of type
instance_variable_defined_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)rb_obj_ivar_defined
call-seq:
obj.instance_variable_defined?(symbol) => true or false
Returns true if the given instance variable is
defined in obj.
class Fred
def initialize(p1, p2)
@a, @b = p1, p2
end
end
fred = Fred.new('cat', 99)
fred.instance_variable_defined?(:@a) #=> true
fred.instance_variable_defined?("@b") #=> true
fred.instance_variable_defined?("@c") #=> false
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| name | org.jruby.runtime.builtin.IRubyObject | of ivar |
Returns: true if defined
instance_variable_get(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)rb_obj_ivar_get
call-seq:
obj.instance_variable_get(symbol) => obj
Returns the value of the given instance variable, or nil if the
instance variable is not set. The @ part of the
variable name should be included for regular instance
variables. Throws a NameError exception if the
supplied symbol is not valid as an instance variable name.
class Fred
def initialize(p1, p2)
@a, @b = p1, p2
end
end
fred = Fred.new('cat', 99)
fred.instance_variable_get(:@a) #=> "cat"
fred.instance_variable_get("@b") #=> 99
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| name | org.jruby.runtime.builtin.IRubyObject | of ivar |
Returns: value of ivar
getInstanceVariableList() · also: get_instance_variable_listGets a list of all variables in this object.
getInstanceVariableNameList() · also: get_instance_variable_name_listGets a name list of all variables in this object.
instance_variable_set(org.jruby.runtime.builtin.IRubyObject name, org.jruby.runtime.builtin.IRubyObject value)rb_obj_ivar_set call-seq: obj.instance_variable_set(symbol, obj) => obj Sets the instance variable names by symbol to object, thereby frustrating the efforts of the class's author to attempt to provide proper encapsulation. The variable did not have to exist prior to this call. class Fred def initialize(p1, p2) @a, @b = p1, p2 end end fred = Fred.new('cat', 99) fred.instance_variable_set(:@a, 'dog') #=> "dog" fred.instance_variable_set(:@c, 'cat') #=> "cat" fred.inspect #=> "#<Fred:0x401b3da8 @a=\"dog\", @b=99, @c=\"cat\">"
| name | type | description |
|---|---|---|
| name | org.jruby.runtime.builtin.IRubyObject | of ivar |
| value | org.jruby.runtime.builtin.IRubyObject | to set |
Returns: value of old set ivar
getInstanceVariables() · also: get_instance_variablesDummy method to avoid a cast, and to avoid polluting the IRubyObject interface with all the instance variable management methods.
instance_variables(org.jruby.runtime.ThreadContext context)rb_obj_instance_variables call-seq: obj.instance_variables => array Returns an array of instance variable names for the receiver. Note that simply defining an accessor does not create the corresponding instance variable. class Fred attr_accessor :a1 def initialize @iv = 3 end end Fred.new.instance_variables #=> [:"@iv"]
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
Returns: list of ivars
getInternalVariables() · also: get_internal_variablesDummy method to avoid a cast, and to avoid polluting the IRubyObject interface with all the instance variable management methods.
isBuiltin(String methodName)A method to determine whether the method named by methodName is a builtin method, i.e. a method built-in to JRuby and loaded during its core boot process.
| name | type | description |
|---|---|---|
| method_name | String | to look for. |
Returns: true if so
getJavaClass() · also: get_java_classWill return the Java interface that most closely can represent this object, when working through Java integration translations.
Returns: the true Java class of this (Ruby) object
kind_of_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject type)rb_obj_is_kind_of
call-seq:
obj.is_a?(class) => true or false
obj.kind_of?(class) => true or false
Returns true if class is the class of
obj, or if class is one of the superclasses of
obj or modules included in obj.
module M; end
class A
include M
end
class B < A; end
class C < B; end
b = B.new
b.instance_of? A #=> false
b.instance_of? B #=> true
b.instance_of? C #=> false
b.instance_of? M #=> false
b.kind_of? A #=> true
b.kind_of? B #=> true
b.kind_of? C #=> false
b.kind_of? M #=> true
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| type | org.jruby.runtime.builtin.IRubyObject | the type |
Returns: true if this is kind of type
makeMetaClass(org.jruby.runtime.ThreadContext context, org.jruby.RubyClass superClass)rb_make_metaclass Will create a new meta class, insert this in the chain of classes for this specific object, and return the generated meta class.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| super_class | org.jruby.RubyClass | the super class |
Returns: the new meta class
makeMetaClassBootstrap(org.jruby.Ruby runtime, org.jruby.RubyClass superClass, org.jruby.RubyClass Class)This will create a new metaclass. This is only used during bootstrapping before
the initial ThreadContext is defined. Normal needs of making a metaclass should use
RubyBasicObject#makeMetaClass(ThreadContext, RubyClass)
| name | type | description |
|---|---|---|
| runtime | org.jruby.Ruby | the runtime |
| super_class | org.jruby.RubyClass | of the metaclass |
| class | org.jruby.RubyClass | a reference to Ruby Class |
Returns: the new metaclass
getMarshalVariableList() · also: get_marshal_variable_listif exist return the meta-class else return the type of the object.
setMetaClass(org.jruby.RubyClass metaClass) · also: set_meta_classMakes it possible to change the metaclass of an object. In practice, this is a simple version of Smalltalks Become, except that it doesn't work when we're dealing with subclasses. In practice it's used to change the singleton/meta class used, without changing the "real" inheritance chain.
| name | type | description |
|---|---|---|
| meta_class | org.jruby.RubyClass | the meta class to set |
method(org.jruby.runtime.builtin.IRubyObject name, org.jruby.parser.StaticScope refinedScope)method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name, org.jruby.parser.StaticScope refinedScope)Like #method(IRubyObject) but using the given refinement scope to search for the method.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| name | org.jruby.runtime.builtin.IRubyObject | the name of the method |
| refined_scope | org.jruby.parser.StaticScope | the static scope for the caller method |
Returns: method instance
methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_obj_methods call-seq: obj.methods => array Returns a list of the names of methods publicly accessible in obj. This will include all the methods accessible in obj's ancestors. class Klass def kMethod() end end k = Klass.new k.methods[0..9] #=> ["kMethod", "freeze", "nil?", "is_a?", "class", "instance_variable_set", "methods", "extend", "__send__", "instance_eval"] k.methods.length #=> 42
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| args | org.jruby.runtime.builtin.IRubyObject[] | include ancestors |
Returns: methods
isNil() · also: is_nilDoes this object represent nil?
Returns: true if nil
rb_false
call_seq:
nil.nil? => true
<anything_else>.nil? => false
Only the object nil responds true to nil?.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
Returns: true if nil
op_match(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)rb_obj_pattern_match
call-seq:
obj =~ other => nil
Pattern Match---Overridden by descendents (notably
Regexp and String) to provide meaningful
pattern-match semantics.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| arg | org.jruby.runtime.builtin.IRubyObject | arg |
Returns: true if matches (always nil)
op_not_equal(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)The != method implemented for BasicObject.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | thread context |
| other | org.jruby.runtime.builtin.IRubyObject | other object |
Returns: false if this == other, true otherwise
op_not_match(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)Invert the match operator.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| arg | org.jruby.runtime.builtin.IRubyObject | arg |
Returns: true if they do not match
private_methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)protected_methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)public_methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rbClone(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject maybeOpts)removeFinalizers()Remove all the finalizers for this object.
remove_instance_variable(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name, org.jruby.runtime.Block block)rb_obj_remove_instance_variable call-seq: obj.remove_instance_variable(symbol) => obj Removes the named instance variable from obj, returning that variable's value. class Dummy attr_reader :var def initialize @var = 99 end def remove remove_instance_variable(:@var) end end d = Dummy.new d.var #=> 99 d.remove #=> 99 d.var #=> nil
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| name | org.jruby.runtime.builtin.IRubyObject | of ivar |
| block | org.jruby.runtime.Block | the block (not used) |
Returns: value of removed ivar
removeInternalVariable(String name)respond_to_p(org.jruby.runtime.builtin.IRubyObject mname)respondsTo(String name)Does this object respond to the specified message? Uses a shortcut if it can be proved that respond_to? and respond_to_missing? haven't been overridden.
respondsToMissing(String name)Does this object respond to the specified message via "method_missing?"
respondsToMissing(String name, boolean incPrivate)Does this object respond to the specified message via "method_missing?"
Will return the runtime that this object is associated with.
Returns: current runtime
send(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)send(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)send(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)send(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)send(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)setFlag(int flag, boolean set)setInstanceVariable(String name, org.jruby.runtime.builtin.IRubyObject value)rb_iv_set / rb_ivar_set
setInternalVariable(String name, Object value)setVariable(int index, Object value)singletonClass(org.jruby.runtime.ThreadContext context)Will either return the existing singleton class for this object, or create a new one and return that. For a few types a singleton class is not possible so it will throw an error.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current thread context |
Returns: the singleton of this type
singleton_method(org.jruby.runtime.builtin.IRubyObject name)singleton_method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)singleton_methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)isSpecialConst() · also: is_special_constisSpecialObject() · also: is_special_objectspecificEval(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule mod, org.jruby.runtime.Block block, org.jruby.EvalType evalType)specific_eval Evaluates the block or string inside of the context of this object, using the supplied arguments. If a block is given, this will be yielded in the specific context of this object. If no block is given then a String-like object needs to be the first argument, and this string will be evaluated. Second and third arguments in the args-array is optional, but can contain the filename and line of the string under evaluation.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| mod | org.jruby.RubyModule | module to yield in |
| block | org.jruby.runtime.Block | to call |
| eval_type | org.jruby.EvalType | type of evaal to perform |
Returns: the result
specificEval(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule mod, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block, org.jruby.EvalType evalType)specific_eval Evaluates the block or string inside of the context of this object, using the supplied arguments. If a block is given, this will be yielded in the specific context of this object. If no block is given then a String-like object needs to be the first argument, and this string will be evaluated. Second and third arguments in the args-array is optional, but can contain the filename and line of the string under evaluation.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| mod | org.jruby.RubyModule | module to yield in |
| arg | org.jruby.runtime.builtin.IRubyObject | to pass to block |
| block | org.jruby.runtime.Block | to call |
| eval_type | org.jruby.EvalType | type of evaal to perform |
Returns: the result
specificEval(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule mod, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block, org.jruby.EvalType evalType)specific_eval Evaluates the block or string inside of the context of this object, using the supplied arguments. If a block is given, this will be yielded in the specific context of this object. If no block is given then a String-like object needs to be the first argument, and this string will be evaluated. Second and third arguments in the args-array is optional, but can contain the filename and line of the string under evaluation.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| mod | org.jruby.RubyModule | module to yield in |
| arg0 | org.jruby.runtime.builtin.IRubyObject | to pass to block |
| arg1 | org.jruby.runtime.builtin.IRubyObject | to pass to block |
| block | org.jruby.runtime.Block | to call |
| eval_type | org.jruby.EvalType | type of evaal to perform |
Returns: the result
specificEval(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule mod, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block, org.jruby.EvalType evalType)specific_eval Evaluates the block or string inside of the context of this object, using the supplied arguments. If a block is given, this will be yielded in the specific context of this object. If no block is given then a String-like object needs to be the first argument, and this string will be evaluated. Second and third arguments in the args-array is optional, but can contain the filename and line of the string under evaluation.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| mod | org.jruby.RubyModule | module to yield in |
| arg0 | org.jruby.runtime.builtin.IRubyObject | to pass to block |
| arg1 | org.jruby.runtime.builtin.IRubyObject | to pass to block |
| arg2 | org.jruby.runtime.builtin.IRubyObject | to pass to block |
| block | org.jruby.runtime.Block | to call |
| eval_type | org.jruby.EvalType | type of evaal to perform |
Returns: the result
syncVariables(org.jruby.runtime.builtin.IRubyObject other)Sync one this object's variables with other's - this is used to make rbClone work correctly.
setTaint(boolean taint) · also: set_taintisTaint() · also: is_tainttainted_p(org.jruby.runtime.ThreadContext context)isTrue() · also: is_trueIs this value a truthy value or not?
Returns: true if truthy
rb_obj_class Returns the real class of this object, excluding any singleton/meta class in the inheritance chain.
Returns: the real class
untaint(org.jruby.runtime.ThreadContext context)Gets a list of all variables in this object.
getVariableNameList() · also: get_variable_name_listGets a name list of all variables in this object.
| field | type | note |
|---|---|---|
| IVAR_INSPECTING_OBJECT_ALLOCATOR | ObjectAllocator | Allocator that inspects all methods for instance variables and chooses a concrete class to construct based on that. This allows using specialized subclasses to hold instance variables in fields rather than always holding them in an array. |
| OBJECT_ALLOCATOR | ObjectAllocator | Default allocator instance for all Ruby objects. The only reason to not use this allocator is if you actually need to have all instances of something be a subclass of RubyObject. |
| REIFYING_OBJECT_ALLOCATOR | ObjectAllocator |
attachToObjectSpace()Will make sure that this object is added to the current object space.
callInit(org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)Call the Ruby initialize method with the supplied arguments and block.
| name | type | description |
|---|---|---|
| args | org.jruby.runtime.builtin.IRubyObject[] | args |
| block | org.jruby.runtime.Block | block |
Call the Ruby initialize method with the supplied arguments and block.
| name | type | description |
|---|---|---|
| block | org.jruby.runtime.Block | block |
callInit(org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)Call the Ruby initialize method with the supplied arguments and block.
| name | type | description |
|---|---|---|
| arg0 | org.jruby.runtime.builtin.IRubyObject | arg0 |
| block | org.jruby.runtime.Block | block |
callInit(org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)Call the Ruby initialize method with the supplied arguments and block.
| name | type | description |
|---|---|---|
| arg0 | org.jruby.runtime.builtin.IRubyObject | arg0 |
| arg1 | org.jruby.runtime.builtin.IRubyObject | arg1 |
| block | org.jruby.runtime.Block | block |
callInit(org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)callInit(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)callInit(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)callInit(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)callInit(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)callInit(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)toRubyString(org.jruby.runtime.ThreadContext context)The default toString method is just a wrapper that calls the Ruby "to_s" method. This will raise if it is not actually a Ruby String.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | thread context this is executing on. |
Returns: the string.
toString()The default toString method is just a wrapper that calls the Ruby "to_s" method.
Returns: string representation
| field | type | note |
|---|---|---|
| BUILTIN_CONSTANT | String | |
| CACHEPROXY_F | int | |
| INCLUDED_INTO_REFINEMENT | int | |
| IS_OVERLAID_F | int | |
| MODULE_ALLOCATOR | ObjectAllocator | |
| NEEDSIMPL_F | int | |
| OMOD_SHARED | int | |
| REFINED_MODULE_F | int | |
| TEMPORARY_NAME | int | |
| id | int | |
| kindOf | RubyModule.KindOf | |
| parent | RubyModule | The class/module within whose namespace this class/module resides. |
_module_function(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_mod_modfunc
_private(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_mod_private
_protected(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_mod_protected
_public(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_mod_public
addClassProvider(org.jruby.util.ClassProvider provider)addIncludingHierarchy(org.jruby.IncludedModule hierarchy)addMethod(String id, org.jruby.internal.runtime.methods.DynamicMethod method)addMethod(org.jruby.runtime.ThreadContext context, String id, org.jruby.internal.runtime.methods.DynamicMethod method)addMethodInternal(String name, org.jruby.internal.runtime.methods.DynamicMethod method)addMethodInternal(org.jruby.runtime.ThreadContext context, String name, org.jruby.internal.runtime.methods.DynamicMethod method)addModuleFunction(String name, org.jruby.internal.runtime.methods.DynamicMethod method)addReadAttribute(org.jruby.runtime.ThreadContext context, String name)addReadWriteAttribute(org.jruby.runtime.ThreadContext context, String name)addWriteAttribute(org.jruby.runtime.ThreadContext context, String name)aliasMethod(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject newId, org.jruby.runtime.builtin.IRubyObject oldId)Add an alias under the name newId pointing at the method under the name oldId.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current context |
| new_id | org.jruby.runtime.builtin.IRubyObject | the new name for the alias |
| old_id | org.jruby.runtime.builtin.IRubyObject | the current name of the method |
Returns: the new name
alias_method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject newId, org.jruby.runtime.builtin.IRubyObject oldId)Old version of #aliasMethod(ThreadContext, IRubyObject, IRubyObject) that returns this module. The Ruby
alias_method method was updated in 3.0 to return the new name.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current context |
| new_id | org.jruby.runtime.builtin.IRubyObject | the new name for the alias |
| old_id | org.jruby.runtime.builtin.IRubyObject | the current name of the method |
Returns: this module
ancestors(org.jruby.runtime.ThreadContext context)rb_mod_ancestors
append_features(org.jruby.runtime.builtin.IRubyObject include)append_features(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject include)rb_mod_append_features
attr(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_mod_attr
attr_accessor(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_mod_attr_accessor Note: this method should not be called from Java in most cases, since it depends on Ruby frame state for visibility. Use add[Read/Write]Attribute instead.
attr_reader(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_mod_attr_reader
attr_writer(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_mod_attr_writer
autoload(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol, org.jruby.runtime.builtin.IRubyObject file)autoload_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol)autoload_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol, org.jruby.runtime.builtin.IRubyObject inherit)autoloadingValue(org.jruby.Ruby runtime, String name)autoloadingValue(org.jruby.runtime.ThreadContext context, String name)getBaseName() · also: get_base_nameGet the base name of this class, or null if it is an anonymous class.
Returns: base name of the class
baseName(String name)Set the base name of the class. If null, the class effectively becomes anonymous (though constants elsewhere may reference it).
| name | type | description |
|---|---|---|
| name | String | the new base name of the class |
Returns: itself for a composable API.
setBaseName(String name) · also: set_base_nameorg.jruby.RubyModule#baseName(String) instead.
Set the base name of the class. If null, the class effectively becomes anonymous (though constants elsewhere may reference it).
| name | type | description |
|---|---|---|
| name | String | the new base name of the class |
getCacheProxy() · also: get_cache_proxyGet whether this Java proxy class should try to keep its instances idempotent and alive using the ObjectProxyCache.
setCacheProxy(boolean cacheProxy) · also: set_cache_proxySet whether this Java proxy class should try to keep its instances idempotent and alive using the ObjectProxyCache.
checkFrozen()checkValidBindTargetFrom(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule originModule, boolean fromBind)Get the ClassIndex for this class. Will be NO_CLASS for non-core types.
Sets the ClassIndex for this type
| name | type | description |
|---|---|---|
| class_index | org.jruby.runtime.ClassIndex | to be set |
Returns: itself for composable API
class_variable_defined_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject var)class_variable_get(org.jruby.runtime.builtin.IRubyObject name)class_variable_get(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)rb_mod_cvar_get
class_variable_get19(org.jruby.runtime.builtin.IRubyObject name)getClassVariableNameList() · also: get_class_variable_name_listclass_variable_set(org.jruby.runtime.builtin.IRubyObject name, org.jruby.runtime.builtin.IRubyObject value)class_variable_set(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name, org.jruby.runtime.builtin.IRubyObject value)rb_mod_cvar_set
class_variable_set19(org.jruby.runtime.builtin.IRubyObject name, org.jruby.runtime.builtin.IRubyObject value)class_variables(org.jruby.runtime.ThreadContext context)class_variables(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject inherit)const_added(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject _newConstant)constDefined(String name)constDefined(org.jruby.runtime.ThreadContext context, String name)constDefinedAt(String name)constDefinedAt(org.jruby.runtime.ThreadContext context, String name)constDefinedFrom(String name)constDefinedFrom(org.jruby.runtime.ThreadContext context, String name)const_defined_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)rb_mod_const_defined
const_defined_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name, org.jruby.runtime.builtin.IRubyObject recurse)const_get(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0)const_get(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1)const_get(org.jruby.runtime.builtin.IRubyObject symbol)const_get(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)const_get_1_9(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)const_get_2_0(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)const_missing(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject rubyName, org.jruby.runtime.Block block)Base implementation of Module#const_missing, throws NameError for specific missing constant.
| name | type | description |
|---|---|---|
| ruby_name | org.jruby.runtime.builtin.IRubyObject | The constant name which was found to be missing |
Returns: Nothing! Absolutely nothing! (though subclasses might choose to return something)
const_set(org.jruby.runtime.builtin.IRubyObject name, org.jruby.runtime.builtin.IRubyObject value)const_set(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name, org.jruby.runtime.builtin.IRubyObject value)rb_mod_const_set
const_source_location(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)getConstantMap() · also: get_constant_mapgetConstantMapForWrite() · also: get_constant_map_for_writegetConstantNames() · also: get_constant_namesReturns: a list of constant names that exists at time this was called
constants(org.jruby.runtime.ThreadContext context)constants(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject allConstants)constantsCommon(org.jruby.Ruby runtime, boolean replaceModule, boolean allConstants)rb_mod_constants
constantsCommon(org.jruby.Ruby runtime, boolean replaceModule, boolean allConstants, boolean includePrivate)defineAlias(String name, String oldName)RubyModule#aliasMethod(ThreadContext, IRubyObject, IRubyObject) instead
defineAlias(org.jruby.runtime.ThreadContext context, String name, String oldName)Define an alias on this module/class.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current thread context |
| name | String | the new alias name |
| old_name | String | the existing method name |
Returns: itself for composable API
defineAnnotatedConstant(java.lang.reflect.Field field)RubyModule#defineAnnotatedConstant(ThreadContext, Field) instead.
Returns: ""
defineAnnotatedConstants(Class clazz)RubyModule#defineConstants(ThreadContext, Class) instead.
defineAnnotatedMethod(Class clazz, String name)RubyModule#defineMethods(ThreadContext, Class[]) and organize your method
definitions where you only specify the .class and not needing to add a name as a discriminator. This
method is fairly inefficient since it is rescanning the class for all methods to find a single version.
defineAnnotatedMethod(String name, List<org.jruby.anno.JavaMethodDescriptor> methods, org.jruby.runtime.MethodFactory methodFactory)RubyModule#defineMethods(ThreadContext, Class[]) instead and organize your
code around all JRubyMethod annotations in that .class being defined.
Note: it is your responsibility to only pass methods which are annotated with @JRubyMethod. It will perform this check when only a single method is passed in but has never checked when more than one.
defineAnnotatedMethod(org.jruby.runtime.ThreadContext context, String name, List<org.jruby.anno.JavaMethodDescriptor> methods, org.jruby.runtime.MethodFactory methodFactory)This is an internal API used by the type populator. This method takes a list of overloads for a static or non-static method and generates the
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current method context |
defineAnnotatedMethod(java.lang.reflect.Method method, org.jruby.runtime.MethodFactory methodFactory)defineAnnotatedMethod(String name, org.jruby.anno.JavaMethodDescriptor desc, org.jruby.runtime.MethodFactory methodFactory)defineAnnotatedMethods(Class clazz)RubyModule#defineMethods(ThreadContext, Class[]) instead.
defineAnnotatedMethodsIndividually(Class clazz)defineClassUnder(org.jruby.runtime.ThreadContext context, String name, org.jruby.RubyClass superClass, org.jruby.runtime.ObjectAllocator allocator)Define a Class under this Class/Module.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current thread context |
| name | String | name of the new class |
| super_class | org.jruby.RubyClass | superclass of this new class |
| allocator | org.jruby.runtime.ObjectAllocator | how to allocate an instance of this class |
Returns: the new class
defineClassUnder(org.jruby.runtime.ThreadContext context, String name, org.jruby.RubyClass superClazz, org.jruby.runtime.ObjectAllocator allocator, String file, int line)Internal API only used by our IR runtime helpers in setting up Ruby-defined classes or re-accessing them
if they already exist. Look at
RubyModule#defineClassUnder(ThreadContext, String, RubyClass, ObjectAllocator) for native
extensions.
| name | type | description |
|---|---|---|
| name | String | to be defined |
| super_clazz | org.jruby.RubyClass | the super class of this new class |
| allocator | org.jruby.runtime.ObjectAllocator | how to allocate it |
| file | String | location where it was defined from |
| line | int | location where it was defined from |
Returns: the new class.
defineClassUnder(String name, org.jruby.RubyClass superClass, org.jruby.runtime.ObjectAllocator allocator)RubyModule#defineClassUnder(ThreadContext, String, RubyClass, ObjectAllocator) instead.
Returns: ""
defineConstant(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject value)Define a constant when you are defining your Ruby class/module.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current thread context |
| name | String | the name of the constant |
| value | org.jruby.runtime.builtin.IRubyObject | the value for the constant |
Returns: itself for a composable API
defineConstant(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject value, boolean hidden)Define a constant when you are defining your Ruby class/module.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current thread context |
| name | String | the name of the constant |
| value | org.jruby.runtime.builtin.IRubyObject | the value for the constant |
| hidden | boolean | should this be a hidden constant |
Returns: itself for a composable API
defineConstant(String name, org.jruby.runtime.builtin.IRubyObject value)rb_define_const
defineConstantBootstrap(String name, org.jruby.runtime.builtin.IRubyObject value)This is an internal API which is only used during runtime creation but BEFORE the first ThreadContext is created. Nothing other that a few constants in the Ruby constructor should be calling this. This method has no error checks. A secondary goal of this method is that it does not access Ruby or ThreadContext in any way.
| name | type | description |
|---|---|---|
| name | String | of the constant |
| value | org.jruby.runtime.builtin.IRubyObject | of the constant |
defineConstants(org.jruby.runtime.ThreadContext context, Class constantSource)Define constant for your module/class with the supplied Class which contains @JRubyMethod annotations.
| name | type | description |
|---|---|---|
| constant_source | Class | class containing the method annotations |
Returns: itself for composable API
defineConstantsFrom(org.jruby.runtime.ThreadContext context, Class<C> enumClass)Define all constants from the given jnr-constants enum which are defined on the current platform.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current thread context |
| enum_class | Class<C> | the enum class of the constants to define |
Returns: itself for composable API
define_method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)define_method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)defineMethodFromBlock(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block, org.jruby.runtime.Visibility visibility)defineMethodFromCallable(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Visibility visibility)defineMethods(org.jruby.runtime.ThreadContext context, Class[] methodSources)Define methods for your module/class with the supplied Class which contains @JRubyMethod annotations.
| name | type | description |
|---|---|---|
| method_sources | Class[] | class containing the method annotations |
Returns: itself for composable API
defineModuleUnder(org.jruby.runtime.ThreadContext context, String name)Define a module under this module.
Returns: itself for a composable API
defineOrGetClassUnder(String name, org.jruby.RubyClass superClazz, org.jruby.runtime.ObjectAllocator allocator)defineOrGetClassUnder(String name, org.jruby.RubyClass superClazz, org.jruby.runtime.ObjectAllocator allocator, String file, int line)this method should be used only by interpreter or compiler
defineOrGetModuleUnder(String name, String file, int line)defineOrGetModuleUnder(org.jruby.runtime.ThreadContext context, String name, String file, int line)deleteConstant(org.jruby.runtime.ThreadContext context, String name)deprecateConstant(org.jruby.Ruby runtime, String name)deprecateConstant(org.jruby.runtime.ThreadContext context, String name)Mark the named constant as deprecated.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current thread context |
| name | String | the name of the constant |
deprecate_constant(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)deprecate_constant(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] names)discoverInstanceVariables()equals(Object other)We override equals here to provide a faster path, since equality for modules is pretty cut and dried.
| name | type | description |
|---|---|---|
| other | Object | The object to check for equality |
Returns: true if reference equality, false otherwise
exportMethod(String name, org.jruby.runtime.Visibility visibility)extend_object(org.jruby.runtime.builtin.IRubyObject obj)extend_object(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_mod_extend_object
extendObject(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)extended(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other, org.jruby.runtime.Block block)fastSetConstant(String internedName, org.jruby.runtime.builtin.IRubyObject value)fetchConstant(org.jruby.runtime.ThreadContext context, String name)fetchConstant(String name, boolean includePrivate)fetchConstant(org.jruby.runtime.ThreadContext context, String name, boolean includePrivate)fetchConstantEntry(String name, boolean includePrivate)fetchConstantEntry(org.jruby.runtime.ThreadContext context, String name, boolean includePrivate)The equivalent for fetchConstant but is useful for extra state like whether the constant is private or not.
| name | type | description |
|---|---|---|
| name | String | of the constant. |
| include_private | boolean | include private/hidden constants |
Returns: the entry for the constant.
Find the given class in this hierarchy, considering modules along the way.
| name | type | description |
|---|---|---|
| clazz | org.jruby.RubyModule | the class to find |
Returns: The method, or UndefinedMethod if not found
rb_mod_freeze
getGeneration() · also: get_generationgetGenerationObject() · also: get_generation_objectgetAutoloadConstant(org.jruby.runtime.ThreadContext context, String name)Get autoload constant. If it's first resolution for the constant, it tries to require the defined feature and returns the defined value. Multi-threaded accesses are blocked and processed sequentially except if the caller is the autoloading thread.
getClass(org.jruby.runtime.ThreadContext context, String name)Finds a class that is within the current module/class. Also consider using
the various methods in org.jruby.api.Access when they are core types
to avoid a hash lookup.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current thread context |
| name | String | to be found in this module (or class) |
Returns: the class or null if no such class
getClassVar(org.jruby.runtime.ThreadContext context, String name)Retrieve the specified class variable, searching through this module, included modules, and supermodules. Ruby C equivalent = "rb_cvar_get"
| name | type | description |
|---|---|---|
| name | String | The name of the variable to retrieve |
Returns: The variable's value, or throws NameError if not found
getClassVar(org.jruby.runtime.builtin.IRubyObject nameObject, String name)getClassVar(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject nameObject, String name)getConstant(org.jruby.runtime.ThreadContext context, String name)Retrieve the named constant, invoking 'const_missing' should that be appropriate.
| name | type | description |
|---|---|---|
| name | String | The constant to retrieve |
Returns: The value for the constant, or null if not found
getConstant(String name, boolean inherit)getConstant(org.jruby.runtime.ThreadContext context, String name, boolean inherit)getConstant(String name, boolean inherit, boolean includeObject)getConstant(org.jruby.runtime.ThreadContext context, String name, boolean inherit, boolean includeObject)getConstantAt(org.jruby.runtime.ThreadContext context, String name)getConstantAt(String name, boolean includePrivate)getConstantAt(org.jruby.runtime.ThreadContext context, String name, boolean includePrivate)getConstantAtSpecial(org.jruby.runtime.ThreadContext context, String name)This version searches superclasses if we're starting with Object. This corresponds to logic in rb_const_defined_0 that recurses for Object only.
| name | type | description |
|---|---|---|
| name | String | the constant name to find |
Returns: the constant, or null if it was not found
getConstantFrom(org.jruby.runtime.ThreadContext context, String name)getConstantFromConstMissing(String name)getConstantFromConstMissing(org.jruby.runtime.ThreadContext context, String name)getConstantFromNoConstMissing(String name)getConstantFromNoConstMissing(org.jruby.runtime.ThreadContext context, String name)getConstantFromNoConstMissing(String name, boolean includePrivate)getConstantFromNoConstMissing(org.jruby.runtime.ThreadContext context, String name, boolean includePrivate)getConstantNames(boolean includePrivate)getConstantNoConstMissing(String name)getConstantNoConstMissing(org.jruby.runtime.ThreadContext context, String name)getConstantNoConstMissing(String name, boolean inherit)getConstantNoConstMissing(org.jruby.runtime.ThreadContext context, String name, boolean inherit)getConstantNoConstMissing(String name, boolean inherit, boolean includeObject)getConstantNoConstMissing(org.jruby.runtime.ThreadContext context, String name, boolean inherit, boolean includeObject)getConstantNoConstMissingSkipAutoload(String name)getConstantNoConstMissingSkipAutoload(org.jruby.runtime.ThreadContext context, String name)getConstantSourceLocation(String name, boolean inherit, boolean includeObject)getConstantSourceLocation(org.jruby.runtime.ThreadContext context, String name, boolean inherit, boolean includeObject)getConstantWithAutoload(String name, org.jruby.runtime.builtin.IRubyObject failedAutoloadValue, boolean includePrivate)getConstantWithAutoload(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject failedAutoloadValue, boolean includePrivate)Search just this class for a constant value, or trigger autoloading.
getModule(org.jruby.runtime.ThreadContext context, String name)Finds a module that is within the current module (or class).
| name | type | description |
|---|---|---|
| name | String | to be found in this module (or class) |
Returns: the module or null if no such module
Generate a fully-qualified class name or a #-style name for anonymous and singleton classes. Ruby C equivalent = "classname"
Returns: The generated class name
getSimpleName(org.jruby.runtime.ThreadContext context)Get the "simple" name for the class, which is either the "base" name or the "anonymous" class name.
Returns: the "simple" name of the class
hasAutoload(org.jruby.runtime.ThreadContext context, String idString, boolean inherit)hasClassVariable(String name)hasConstant(String name)hasInternalModuleVariable(String name)Behaves similarly to #getClassVar(ThreadContext, String). Searches this
class/module and its ancestors for the specified internal
variable.
| name | type | description |
|---|---|---|
| name | String | the internal variable name |
Returns: the value of the specified internal variable if found, else null
hasModuleInHierarchy(org.jruby.RubyModule type)hasModuleInPrepends(org.jruby.RubyModule type)hasPrepends() · also: has_prependshashCode()getIdTest() · also: get_id_testinclude(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule module)In Defining this type include a module. Note: This is for defining native extensions and differs from method of same name which is live include while executing Ruby code.
| name | type | description |
|---|---|---|
| module | org.jruby.RubyModule | to be included |
Returns: itself for composable API
include(org.jruby.runtime.builtin.IRubyObject[] modules)include(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] modules)rb_mod_include
include(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject module)includeModule(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)Include a new module in this module or class.
| name | type | description |
|---|---|---|
| arg | org.jruby.runtime.builtin.IRubyObject | The module to include |
include_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)included(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)isIncluded() · also: is_includedIs this module one that in an included one (e.g. an IncludedModuleWrapper).
isIncludedIntoRefinement() · also: is_included_into_refinementincluded_modules(org.jruby.runtime.ThreadContext context)rb_mod_included_modules
instance_method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol)instance_method(org.jruby.runtime.builtin.IRubyObject symbol)instanceMethods(org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Visibility visibility, boolean obj, boolean not)instanceMethods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Visibility visibility, boolean obj, boolean not)instanceMethods(org.jruby.runtime.Visibility visibility, boolean includeSuper, boolean obj, boolean not)instance_methods(org.jruby.runtime.builtin.IRubyObject[] args)instance_methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)instance_methods19(org.jruby.runtime.builtin.IRubyObject[] args)invalidateCacheDescendants()invalidateMethodCache(org.jruby.runtime.ThreadContext context)Invalidate the method cache of this class and all descendants under lock.
isClassVarDefined(String name)Is class var defined? Ruby C equivalent = "rb_cvar_defined"
| name | type | description |
|---|---|---|
| name | String | The class var to determine "is defined?" |
Returns: true if true, false if false
isConstantDefined(String name, boolean inherit)isConstantDefined(String name)isConstantDefined(org.jruby.runtime.ThreadContext context, String name)isInstance(org.jruby.runtime.builtin.IRubyObject object)isMethodBound(String name, boolean checkVisibility)MRI: rb_method_boundp
isMethodBuiltin(String methodName)Return true if the given method is defined on this class and is a builtin, i.e. a method built-in to JRuby and loaded during its core boot process.
getJavaProxy() · also: get_java_proxyGet whether this class is associated with (i.e. a proxy for) a normal Java class or interface.
setJavaProxy(boolean javaProxy) · also: set_java_proxySet whether this class is associated with (i.e. a proxy for) a normal Java class or interface.
Set the method for determining whether an Object is a kind of the supplied type.
| name | type | description |
|---|---|---|
| kind_of | org.jruby.RubyModule.KindOf | method to determine kind-of status |
Returns: itself for composblae API
method_added(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject nothing)method_defined_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol)method_defined_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol, org.jruby.runtime.builtin.IRubyObject includeSuper)setMethodLocation(org.jruby.RubyModule module) · also: set_method_locationmethod_removed(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject nothing)method_undefined(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject nothing)getMethodsForWrite() · also: get_methods_for_writemix(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject modArg)mix(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject modArg, org.jruby.runtime.builtin.IRubyObject hash0)module_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)module_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)module_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)module_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)module_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)module_exec(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)module_exec(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)module_function(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)getName() · also: get_nameneedsImplementer()newMethod(org.jruby.runtime.builtin.IRubyObject receiver, String methodName, boolean bound, org.jruby.runtime.Visibility visibility)newMethod(org.jruby.runtime.builtin.IRubyObject receiver, String methodName, org.jruby.parser.StaticScope refinedScope, boolean bound, org.jruby.runtime.Visibility visibility)newMethod(org.jruby.runtime.builtin.IRubyObject receiver, String methodName, boolean bound, org.jruby.runtime.Visibility visibility, boolean respondToMissing)newMethod(org.jruby.runtime.builtin.IRubyObject receiver, String methodName, org.jruby.parser.StaticScope scope, boolean bound, org.jruby.runtime.Visibility visibility, boolean respondToMissing)newMethod(org.jruby.runtime.builtin.IRubyObject receiver, String methodName, boolean bound, org.jruby.runtime.Visibility visibility, boolean respondToMissing, boolean priv)newMethod(org.jruby.runtime.builtin.IRubyObject receiver, String methodName, org.jruby.parser.StaticScope scope, boolean bound, org.jruby.runtime.Visibility visibility, boolean respondToMissing, boolean priv)op_cmp(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_mod_cmp
op_eqq(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_mod_eqq
op_equal(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)op_ge(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_mod_ge
op_gt(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_mod_gt
op_le(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)MRI: rb_class_inherited_p
op_lt(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_mod_lt
In an included or prepended module what is the ACTUAL module it represents?
Returns: the actual module of an included/prepended module.
prepend(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] modules)prepend_features(org.jruby.runtime.builtin.IRubyObject include)prepend_features(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject include)rb_mod_prepend_features
prependModule(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule module)Prepend a new module to this module or class. MRI: rb_prepend_module
| name | type | description |
|---|---|---|
| module | org.jruby.RubyModule | The module to include |
prepended(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)isPrepended() · also: is_prependedprivate_class_method(org.jruby.runtime.builtin.IRubyObject[] args)private_class_method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)private_constant(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)private_constant(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] rubyNames)private_instance_methods(org.jruby.runtime.builtin.IRubyObject[] args)private_instance_methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_class_private_instance_methods
private_method_defined(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol)private_method_defined(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol, org.jruby.runtime.builtin.IRubyObject includeSuper)protected_instance_methods(org.jruby.runtime.builtin.IRubyObject[] args)protected_instance_methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_class_protected_instance_methods
protected_method_defined(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol)protected_method_defined(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol, org.jruby.runtime.builtin.IRubyObject includeSuper)public_class_method(org.jruby.runtime.builtin.IRubyObject[] args)public_class_method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)publicConstDefinedFrom(String name)publicConstDefinedFrom(org.jruby.runtime.ThreadContext context, String name)public_constant(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)public_constant(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] rubyNames)public_instance_method(org.jruby.runtime.builtin.IRubyObject symbol)public_instance_method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol)public_instance_methods(org.jruby.runtime.builtin.IRubyObject[] args)public_instance_methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)public_instance_methods19(org.jruby.runtime.builtin.IRubyObject[] args)public_method_defined(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol)public_method_defined(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject symbol, org.jruby.runtime.builtin.IRubyObject includeSuper)putAlias(String id, org.jruby.internal.runtime.methods.DynamicMethod method, String oldName)putAlias(org.jruby.runtime.ThreadContext context, String id, org.jruby.internal.runtime.methods.DynamicMethod method, String oldName)Note: Internal API - only public as its used by generated code!
Note: Used by AnnotationBinder.
Note: Not safe for target methods that super, since the frame class will not reflect original source.
putAlias(String id, org.jruby.runtime.callsite.CacheEntry entry, String oldName)putAlias(org.jruby.runtime.ThreadContext context, String id, org.jruby.runtime.callsite.CacheEntry entry, String oldName)Alias the method contained in the given CacheEntry as a new entry in this module.
putMethod(org.jruby.Ruby runtime, String id, org.jruby.internal.runtime.methods.DynamicMethod method)putMethod(org.jruby.runtime.ThreadContext context, String id, org.jruby.internal.runtime.methods.DynamicMethod method)Note: Internal API - only public as its used by generated code!
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current thread context |
| id | String | identifier string (8859_1). Matching entry in symbol table. |
Returns: method
rbPrivate(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rbProtected(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rbPublic(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)refine(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject klass, org.jruby.runtime.Block block)refined_class(org.jruby.runtime.ThreadContext context)isRefinement() · also: is_refinementrefinements(org.jruby.runtime.ThreadContext context)setRefinements(Map<org.jruby.RubyModule,org.jruby.RubyModule> refinements) · also: set_refinementsgetRefinementsForWrite() · also: get_refinements_for_writeremoveClassProvider(org.jruby.util.ClassProvider provider)remove_class_variable(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)rb_mod_remove_cvar
removeClassVariable(org.jruby.runtime.ThreadContext context, String name)remove_class_variable19(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)remove_const(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject rubyName)removeMethod(org.jruby.runtime.ThreadContext context, String id)remove_method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)resolveRefinedMethod(org.jruby.RubyModule overlay, org.jruby.runtime.callsite.CacheEntry entry, String id)respondsToMethod(String name, boolean checkVisibility, org.jruby.parser.StaticScope scope)respondsToMethod(String name, boolean checkVisibility)Search through this module and supermodules for method definitions. Cache superclass definitions in this class.
| name | type | description |
|---|---|---|
| name | String | The name of the method to search for |
Returns: The method, or UndefinedMethod if not found
ruby2_keywords(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rubyBaseName(org.jruby.runtime.ThreadContext context)rubyName(org.jruby.runtime.ThreadContext context)Generate a fully-qualified class name or a #-style name for anonymous and singleton classes which is properly encoded. The returned string is always frozen.
Returns: a properly encoded class name. Note: getId() is only really valid for ASCII values. This should be favored over using it.
searchInternalModuleVariable(String name)Behaves similarly to #getClassVar(ThreadContext, String). Searches this
class/module and its ancestors for the specified internal
variable.
| name | type | description |
|---|---|---|
| name | String | the internal variable name |
Returns: the value of the specified internal variable if found, else null
Search through this module and supermodules for method definitions. Cache superclass definitions in this class.
| name | type | description |
|---|---|---|
| name | String | The name of the method to search for |
Returns: The method, or UndefinedMethod if not found
Search for the named method in this class and in superclasses, and if found return the CacheEntry representing the method and this class's serial number. MRI: method_entry_get
| name | type | description |
|---|---|---|
| name | String | the method name |
Returns: the CacheEntry corresponding to the method and this class's serial number
searchWithCache(String id, boolean cacheUndef)searchWithRefinements(String name, org.jruby.parser.StaticScope refinedScope)Search for the named method in this class and in superclasses applying refinements from the given scope. If found return the method; otherwise, return UndefinedMethod.
| name | type | description |
|---|---|---|
| name | String | the method name |
| refined_scope | org.jruby.parser.StaticScope | the scope containing refinements to search |
Returns: the method or UndefinedMethod
setClassVar(String name, org.jruby.runtime.builtin.IRubyObject value)setClassVar(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject value)Set the named class variable to the given value, provided freeze allows setting it. Ruby C equivalent = "rb_cvar_set"
| name | type | description |
|---|---|---|
| name | String | The variable name to set |
| value | org.jruby.runtime.builtin.IRubyObject | The value to set it to |
setConstant(String name, org.jruby.runtime.builtin.IRubyObject value)setConstant(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject value)Set the named constant on this module. Also, if the value provided is another Module and that module has not yet been named, assign it the specified name.
| name | type | description |
|---|---|---|
| name | String | The name to assign |
| value | org.jruby.runtime.builtin.IRubyObject | The value to assign to it; if an unnamed Module, also set its basename to name |
Returns: The result of setting the variable.
setConstant(String name, org.jruby.runtime.builtin.IRubyObject value, String file, int line)setConstant(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject value, String file, int line)setConstant(String name, org.jruby.runtime.builtin.IRubyObject value, boolean hidden)setConstant(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject value, boolean hidden)setConstantQuiet(String name, org.jruby.runtime.builtin.IRubyObject value)setConstantQuiet(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject value)Set the named constant on this module. Also, if the value provided is another Module and that module has not yet been named, assign it the specified name. This version does not warn if the constant has already been set.
| name | type | description |
|---|---|---|
| name | String | The name to assign |
| value | org.jruby.runtime.builtin.IRubyObject | The value to assign to it; if an unnamed Module, also set its basename to name |
Returns: The result of setting the variable.
setConstantVisibility(org.jruby.Ruby runtime, String name, boolean hidden)setConstantVisibility(org.jruby.runtime.ThreadContext context, String name, boolean hidden)setInternalModuleVariable(String name, org.jruby.runtime.builtin.IRubyObject value)Behaves similarly to #setClassVar(ThreadContext, String, IRubyObject). If the
specified internal variable is found in this class/module or an ancestor,
it is set where found. Otherwise it is set in this module.
| name | type | description |
|---|---|---|
| name | String | the internal variable name |
| value | org.jruby.runtime.builtin.IRubyObject | the internal variable value |
setMethodVisibility(org.jruby.runtime.builtin.IRubyObject[] methods, org.jruby.runtime.Visibility visibility)setMethodVisibility(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] methods, org.jruby.runtime.Visibility visibility)set_method_visibility
set_temporary_name(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)getSimpleName() · also: get_simple_namesingleton_class_p(org.jruby.runtime.ThreadContext context)storeClassVariable(String name, org.jruby.runtime.builtin.IRubyObject value)storeClassVariable(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject value)storeConstant(String name, org.jruby.runtime.builtin.IRubyObject value)storeConstant(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject value)storeConstant(String name, org.jruby.runtime.builtin.IRubyObject value, boolean hidden, String file, int line)storeConstant(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject value, boolean hidden, String file, int line)storeConstant(String name, org.jruby.runtime.builtin.IRubyObject value, boolean hidden)Getter for property superClass.
Returns: Value of property superClass.
Get this module/class super class.
Returns: the super class
Set this module/class super class.
| name | type | description |
|---|---|---|
| super_class | org.jruby.RubyClass | to be set |
Returns: itself for composable API
setSuperClass(org.jruby.RubyClass superClass) · also: set_super_classRubyModule#superClass(RubyClass) instead.
symbolName(org.jruby.runtime.ThreadContext context)Generate a fully-qualified class name or a #-style name as a Symbol. If any element of the path is anonymous, returns null.
Returns: a properly encoded non-anonymous class path as a Symbol, or null.
isSynchronized() · also: is_synchronizedtap(java.util.function.Consumer<T> consumer)Provide itself to a lambda then return itself.
| name | type | description |
|---|---|---|
| consumer | java.util.function.Consumer<T> | to be given this |
Returns: this
rb_mod_to_s
undef(org.jruby.runtime.ThreadContext context, String name)rb_undef
undef_method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)undefMethods(org.jruby.runtime.ThreadContext context, String[] names)Undefine a method from this type.
| name | type | description |
|---|---|---|
| names | String[] | the methods to undefine |
Returns: this type for composable API
undefineMethod(String name)RubyModule#undefMethods(ThreadContext, String...) instead.
undefined_instance_method(org.jruby.runtime.ThreadContext context)updateGeneration()used_modules(org.jruby.runtime.ThreadContext context)used_refinements(org.jruby.runtime.ThreadContext context)using(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject refinedModule)usingTemporaryName()