Top Inners Fields Constructors Methods
org.jruby

public Class RubyModule

extends RubyObject
Class Inheritance
Known Direct Subclasses
org.jruby.javasupport.JavaPackage, org.jruby.RubyClass
Annotations
@JRubyClass
name:Module
Imports
com.headius.invokebinder.Binder, java.lang.invoke.MethodHandle, .MethodHandles, .VarHandle, java.lang.reflect.Field, .Method, .Modifier, java.util.ArrayList, .Arrays, .Collection, .Collections, .EnumSet, .HashMap, .HashSet, .IdentityHashMap, .List, .Map, .Set, java.util.concurrent.ConcurrentHashMap, .CopyOnWriteArraySet, java.util.function.Consumer, jnr.constants.Constant, org.jcodings.Encoding, org.jcodings.specific.USASCIIEncoding, org.jruby.anno.AnnotationBinder, .AnnotationHelper, .FrameField, .JRubyClass, .JRubyConstant, .JRubyMethod, .JavaMethodDescriptor, .TypePopulator, org.jruby.api.JRubyAPI, .Warn, org.jruby.common.IRubyWarnings.ID, org.jruby.embed.Extension, org.jruby.exceptions.LoadError, .RaiseException, .RuntimeError, org.jruby.internal.runtime.AbstractIRMethod, org.jruby.internal.runtime.methods.AliasMethod, .AttrReaderMethod, .AttrWriterMethod, .DefineMethodMethod, .DelegatingDynamicMethod, .DynamicMethod, .JavaMethod, .NativeCallMethod, .PartialDelegatingMethod, .ProcMethod, .RefinedMarker, .RefinedWrapper, .SynchronizedDynamicMethod, .UndefinedMethod, org.jruby.ir.IRClosure, .IRMethod, .Interp, .JIT, org.jruby.javasupport.JavaUtil, org.jruby.javasupport.binding.MethodGatherer, org.jruby.parser.StaticScope, org.jruby.runtime.Arity, .Block, .CallType, .ClassIndex, .Constants, .Helpers, .IRBlockBody, .MethodFactory, .MethodIndex, .ObjectAllocator, .PositionAware, .Signature, .ThreadContext, .Visibility, org.jruby.runtime.backtrace.RubyStackTraceElement, org.jruby.runtime.builtin.IRubyObject, .Variable, org.jruby.runtime.callsite.CacheEntry, org.jruby.runtime.load.LoadService, org.jruby.runtime.marshal.MarshalDumper, .MarshalLoader, org.jruby.runtime.opto.Invalidator, .OptoFactory, org.jruby.runtime.profile.MethodEnhancer, org.jruby.util.RubyStringBuilder, .ByteList, .ClassProvider, .IdUtil, .StringSupport, org.jruby.util.cli.Options, org.jruby.util.io.RubyInputStream, .RubyOutputStream, org.jruby.util.log.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
RubyModule.Autoload

Objects for holding autoload state for the defined constant.

public static interface
protected abstract static class
public static class
RubyModule.ConstantEntry

Represents a constant value, possibly hidden (private).

public static class
public static class
public static class
public static class
public static class
protected static class
public static class
private class
public static class
public static interface
pack-priv static class
protected static class
protected abstract static class
RubyModule.WrapperCacheEntryFactory

A wrapper CacheEntryFactory, for delegating cache entry creation along a chain.

Field Summary

Modifier and TypeField and Description
private volatile Map<String, RubyModule.Autoload>
private static final VarHandle
protected String
baseName

The base name of this class/module, excluding nesting.

public static final String
protected Map<String, CacheEntry>
private transient String
cachedName

The cached name, full class name e.g. Foo::Bar if this class and all containing classes are non-anonymous.

private transient RubyString
private transient IRubyObject
private volatile RubyModule.CacheEntryFactory
public static final int
private static final VarHandle
protected ClassIndex
private transient volatile Set<ClassProvider>
private volatile Map<String, IRubyObject>
private static final VarHandle
private volatile Map<String, RubyModule.ConstantEntry>
private static final VarHandle
protected int
protected Integer
public final int
private MethodHandle
idTest

Pre-built test that takes ThreadContext, IRubyObject and checks that the object is a module with the same ID as this one.

public static final int
private static final VarHandle
protected volatile RubyClass.RubyClassSet
public int
index

Deprecated use RubyModule#getClassIndex()
The index of this class in the ClassIndex.
public static final int
private boolean
javaProxy

Whether this class proxies a normal Java class

public RubyModule.KindOf
private int
private static final Logger
private static final MethodHandles.Lookup
protected final Invalidator
protected volatile RubyModule
methodLocation

Where are the methods of this module/class located?

protected volatile Map<String, DynamicMethod>
private static final VarHandle
public static final ObjectAllocator
public static final int
protected static final RubyModule.CacheEntryFactory
public static final int
public RubyModule
parent

The class/module within whose namespace this class/module resides.

public static final int
private static final VarHandle
pack-priv volatile RubyModule.RefinementStore
public static final Set<String>
protected RubyClass
public static final int
private static final MethodHandle
testModuleMatch

A handle for invoking the module ID test, to be reused for all idTest handles below.

Inherited from org.jruby.RubyObject:
IVAR_INSPECTING_OBJECT_ALLOCATOROBJECT_ALLOCATORREIFYING_OBJECT_ALLOCATOR

Constructor Summary

AccessConstructor and Description
protected
RubyModule(Ruby runtime, RubyClass metaClass, boolean objectSpace)

separate path for MetaClass construction

protected
RubyModule(Ruby runtime, RubyClass metaClass)

used by MODULE_ALLOCATOR and RubyClass constructors

public
RubyModule(Ruby runtime)

standard path for Module construction

Method Summary

Modifier and TypeMethod and Description
public IRubyObject
_module_function(ThreadContext context, IRubyObject[] args)

rb_mod_modfunc

public IRubyObject
_private(ThreadContext context, IRubyObject[] args)

rb_mod_private

public IRubyObject
_protected(ThreadContext context, IRubyObject[] args)

rb_mod_protected

public IRubyObject
_public(ThreadContext context, IRubyObject[] args)

rb_mod_public

private void
addAccessor(ThreadContext context, RubySymbol identifier, Visibility visibility, boolean readable, boolean writeable)

private void
addActivatedRefinement(ThreadContext context, RubyModule moduleToRefine, RubyModule refinement)

public final synchronized void
public void
public void
addMethod(String id, DynamicMethod method)
Deprecated since 10.0.

public void
public final void
addMethodInternal(String name, DynamicMethod method)
Deprecated since 10.0.

public final void
protected void
addMethodSymbols(Ruby runtime, Set<String> seen, RubyArray<T extends IRubyObject> ary, boolean not, Visibility visibility)
Deprecated since 10.0.

protected void
addMethodSymbols(ThreadContext context, Set<String> seen, RubyArray<T extends IRubyObject> ary, boolean not, Visibility visibility)

public void
addModuleFunction(String name, DynamicMethod method)
Deprecated since 10.0.

public void
public void
private void
protected CacheEntry
addToCache(String id, DynamicMethod method, RubyModule sourceModule, int token)

protected CacheEntry
public void
public RubyModule

Returns:

this module
alias_method
(ThreadContext
the current context
context
,
IRubyObject
the new name for the alias
newId
,
IRubyObject
the current name of the method
oldId
)

Old version of aliasMethod(ThreadContext, IRubyObject, IRubyObject) that returns this module.

public IRubyObject

Returns:

the new name
aliasMethod
(ThreadContext
the current context
context
,
IRubyObject
the new name for the alias
newId
,
IRubyObject
the current name of the method
oldId
)

Add an alias under the name newId pointing at the method under the name oldId.

public RubyArray<T extends IRubyObject>
ancestors(ThreadContext context)

rb_mod_ancestors

public RubyArray<T extends IRubyObject>
ancestors()
Deprecated since 10.0.

pack-priv String
public RubyModule
append_features(IRubyObject include)
Deprecated since 10.0.

public RubyModule
append_features(ThreadContext context, IRubyObject include)

rb_mod_append_features

public IRubyObject
attr(ThreadContext context, IRubyObject[] args)

rb_mod_attr

public IRubyObject
attr_accessor(IRubyObject[] args)
Deprecated

public IRubyObject
attr_accessor(ThreadContext context, 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.

public IRubyObject
attr_reader(IRubyObject[] args)
Deprecated

public IRubyObject
attr_reader(ThreadContext context, IRubyObject[] args)

rb_mod_attr_reader

public IRubyObject
attr_writer(ThreadContext context, IRubyObject[] args)

rb_mod_attr_writer

public IRubyObject
public IRubyObject
public IRubyObject
autoload_p(ThreadContext context, IRubyObject symbol, IRubyObject inherit)

public boolean
autoloadingValue(Ruby runtime, String name)
Deprecated since 10.0.

public boolean
public <T extends RubyModule> T

Returns:

itself for a composable API.
baseName
(String
the new base name of the class
name
)

Set the base name of the class.

public void
private RubyString
private CacheEntry
private String
private RubyString
private String
calculateName(ThreadContext context)

Recalculate the fully-qualified name of this class/module.

private RubyString
private IRubyObject

Returns:

a non-anonymous class path as a Symbol, or null
calculateSymbolName
(ThreadContext context)

Calculate the module's name path as a Symbol.

private RaiseException
private void
private void
private RubyString
checkAutoloadRequired(ThreadContext context, String name, String[] autoloadPath)

private void
protected void
public final void
checkFrozen()

Overrides org.jruby.RubyBasicObject.checkFrozen.

The actual method that checks frozen with the default frozen message from MRI.

private Visibility
checkMethodVisibility(ThreadContext context, IRubyObject symbol, boolean parents)

private void
public void
checkValidBindTargetFrom(ThreadContext context, RubyModule originModule, boolean fromBind)

public IRubyObject
public IRubyObject
class_variable_get(IRubyObject name)
Deprecated since 10.0.

public IRubyObject
class_variable_get(ThreadContext context, IRubyObject name)

rb_mod_cvar_get

public IRubyObject
public IRubyObject
class_variable_set(IRubyObject name, IRubyObject value)
Deprecated since 10.0.

public IRubyObject
class_variable_set(ThreadContext context, IRubyObject name, IRubyObject value)

rb_mod_cvar_set

public IRubyObject
public RubyArray<T extends IRubyObject>
public RubyArray<T extends IRubyObject>
public <T extends RubyModule> T

Returns:

itself for composable API
classIndex
(ClassIndex
to be set
classIndex
)

Sets the ClassIndex for this type

private Collection<String>
classVariablesCommon(boolean inherit)

protected final IRubyObject
cloneMethods(RubyModule clone)
Deprecated since 10.0.

protected final IRubyObject
public IRubyObject
const_added(ThreadContext context, IRubyObject _newConstant)

public RubyBoolean
const_defined_p(ThreadContext context, IRubyObject name)

rb_mod_const_defined

public RubyBoolean
public IRubyObject
public IRubyObject
public IRubyObject
const_get(IRubyObject symbol)
Deprecated

public IRubyObject
const_get(ThreadContext context, IRubyObject... args)
Deprecated

public IRubyObject
const_get_1_9(ThreadContext context, IRubyObject[] args)
Deprecated

public IRubyObject
const_get_2_0(ThreadContext context, IRubyObject[] args)
Deprecated

public IRubyObject

Returns:

Nothing! Absolutely nothing! (though subclasses might choose to return something)
const_missing
(ThreadContext context, IRubyObject
The constant name which was found to be missing
rubyName
,
Block block)

Base implementation of Module#const_missing, throws NameError for specific missing constant.

public IRubyObject
const_set(IRubyObject name, IRubyObject value)
Deprecated since 10.0.

public IRubyObject
const_set(ThreadContext context, IRubyObject name, IRubyObject value)

rb_mod_const_set

public IRubyObject
protected RubyModule.ConstantEntry
public RubyArray<T extends IRubyObject>
public RubyArray<T extends IRubyObject>
constants(ThreadContext context, IRubyObject allConstants)

private RubyArray<?>
constantsCommon(ThreadContext context, boolean replaceModule, boolean allConstants)

public Collection<String>
constantsCommon(Ruby runtime, boolean replaceModule, boolean allConstants)

rb_mod_constants

public Collection<String>
constantsCommon(Ruby runtime, boolean replaceModule, boolean allConstants, boolean includePrivate)

protected boolean
protected IRubyObject
protected IRubyObject
protected IRubyObject
protected IRubyObject
constantTableStore(String name, IRubyObject value, boolean hidden)

protected IRubyObject
constantTableStore(String name, IRubyObject value, boolean hidden, boolean deprecated, String file, int line)

protected IRubyObject
constantTableStore(String name, IRubyObject value, boolean hidden, boolean deprecated)

private boolean
constDefined(ThreadContext context, IRubyObject name, boolean inherit)

public boolean
constDefined(String name)
Deprecated since 10.0.

public boolean
public boolean
constDefinedAt(String name)
Deprecated since 10.0.

public boolean
public boolean
constDefinedFrom(String name)
Deprecated since 10.0.

public boolean
private boolean
constDefinedInner(ThreadContext context, String name, boolean exclude, boolean recurse, boolean visibility)

rb_const_defined_0

private IRubyObject
constGetCommon(ThreadContext context, IRubyObject symbol, boolean inherit)

private RubyModule
private DynamicMethod
createProcMethod(Ruby runtime, String name, Visibility visibility, Block block)

private CacheEntry
private static void
define(ThreadContext context, RubyModule module, JavaMethodDescriptor desc, DynamicMethod dynamicMethod)

public IRubyObject
public IRubyObject
public IRubyObject
define_method(ThreadContext context, IRubyObject[] args, Block block)
Deprecated

public synchronized void
public synchronized <T extends RubyModule> T

Returns:

itself for composable API
defineAlias
(ThreadContext
the current thread context
context
,
String
the new alias name
name
,
String
the existing method name
oldName
)

Define an alias on this module/class.

public synchronized void
defineAliases(List<String> aliases, String oldId)
Deprecated

public final boolean

Returns:

""
defineAnnotatedConstant
(Field field)
Deprecated since 10.0. Use RubyModule#defineAnnotatedConstant(ThreadContext, Field) instead.

private boolean
public final void
public void
defineAnnotatedMethod(Class<T> clazz, String name)
Deprecated since 10.0. Use 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.

public final boolean
defineAnnotatedMethod(String name, List<JavaMethodDescriptor> methods, MethodFactory methodFactory)
Deprecated since 10.0. Use 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.

public final void
defineAnnotatedMethod(ThreadContext
the current method context
context
,
String name, List<JavaMethodDescriptor> methods, MethodFactory methodFactory)

This is an internal API used by the type populator.

public final boolean
defineAnnotatedMethod(Method method, MethodFactory methodFactory)
Deprecated since 10.0.

public final boolean
defineAnnotatedMethod(String name, JavaMethodDescriptor desc, MethodFactory methodFactory)
Deprecated since 10.0.

public void
public final void
defineAnnotatedMethodsIndividually(Class<T> clazz)
Deprecated since 10.0.

protected final void
defineAutoload(String symbol, RubyString path)
Deprecated since 10.0.

protected final void
defineAutoload(ThreadContext context, String symbol, RubyString path)

Define an autoload.

public <T extends RubyClass> T

Returns:

the new class
defineClassUnder
(ThreadContext
the current thread context
context
,
String
name of the new class
name
,
RubyClass
superclass of this new class
superClass
,
ObjectAllocator
how to allocate an instance of this class
allocator
)

Define a Class under this Class/Module.

public RubyClass

Returns:

the new class.
defineClassUnder
(ThreadContext context, String
to be defined
name
,
RubyClass
the super class of this new class
superClazz
,
ObjectAllocator
how to allocate it
allocator
,
String
location where it was defined from
file
,
int
location where it was defined from
line
)

Internal API only used by our IR runtime helpers in setting up Ruby-defined classes or re-accessing them if they already exist.

public RubyClass
public <T extends RubyModule> T

Returns:

itself for a composable API
defineConstant
(ThreadContext
the current thread context
context
,
String
the name of the constant
name
,
IRubyObject
the value for the constant
value
)

Define a constant when you are defining your Ruby class/module.

public <T extends RubyModule> T

Returns:

itself for a composable API
defineConstant
(ThreadContext
the current thread context
context
,
String
the name of the constant
name
,
IRubyObject
the value for the constant
value
,
boolean
should this be a hidden constant
hidden
)

Define a constant when you are defining your Ruby class/module.

public void
defineConstant(String name, IRubyObject value)
Deprecated since 10.0.

rb_define_const

public void
defineConstantBootstrap(String
of the constant
name
,
IRubyObject
of the constant
value
)

This is an internal API which is only used during runtime creation but BEFORE the first ThreadContext is created.

public <T extends RubyModule> T

Returns:

itself for composable API
defineConstants
(ThreadContext context, Class<T>
class containing the method annotations
constantSource
)

Define constant for your module/class with the supplied Class which contains @JRubyMethod annotations.

public <
the enum type, which must implement Constant.
C extends Enum<C> & Constant
, T extends RubyModule>
T

Returns:

itself for composable API
defineConstantsFrom
(ThreadContext
the current thread context
context
,
Class<C>
the enum class of the constants to define
enumClass
)

Define all constants from the given jnr-constants enum which are defined on the current platform.

public IRubyObject
public IRubyObject
public <T extends RubyModule> T

Returns:

itself for composable API
defineMethods
(ThreadContext context, Class<T>...
class containing the method annotations
methodSources
)

Define methods for your module/class with the supplied Class which contains @JRubyMethod annotations.

public RubyModule

Returns:

itself for a composable API
defineModuleUnder
(ThreadContext context, String name)

Define a module under this module.

public RubyModule
defineModuleUnder(String name)
Deprecated

public RubyClass
defineOrGetClassUnder(String name, RubyClass superClazz)
Deprecated since 10.0.

public RubyClass
defineOrGetClassUnder(String name, RubyClass superClazz, String file, int line)
Deprecated since 10.0.

public RubyClass
defineOrGetClassUnder(String name, RubyClass superClazz, ObjectAllocator allocator)
Deprecated since 10.0.

public RubyClass
defineOrGetClassUnder(String name, RubyClass superClazz, ObjectAllocator allocator, String file, int line)
Deprecated since 10.0.

public RubyModule
defineOrGetModuleUnder(String name)
Deprecated since 10.0.

this method should be used only by interpreter or compiler

public RubyModule
defineOrGetModuleUnder(String name, String file, int line)
Deprecated since 10.0.

public RubyModule
defineOrGetModuleUnder(ThreadContext context, String name, String file, int line)

public IRubyObject
deleteClassVariable(String name)
Deprecated since 10.0.

private IRubyObject
public IRubyObject
deleteConstant(String name)
Deprecated since 10.0.

public IRubyObject
public IRubyObject
public IRubyObject
public void
deprecateConstant(Ruby runtime, String name)
Deprecated since 10.0.

public void
deprecateConstant(ThreadContext
the current thread context
context
,
String
the name of the constant
name
)

Mark the named constant as deprecated.

public Set<String>
pack-priv void
doIncludeModule(ThreadContext context, RubyModule
The module to include, along with any modules it itself includes
baseModule
)

Include the given module and all related modules into the hierarchy above this module/class.

pack-priv void
doPrependModule(ThreadContext context, RubyModule
The module to prepend, along with any modules it itself includes
baseModule
)

Prepend the given module and all related modules into the hierarchy above this module/class.

protected final void
ensureClassVariablesSettable()
Deprecated since 10.0.

protected final void
ensureConstantsSettable()
Deprecated since 10.0.

public boolean

Returns:

true if reference equality, false otherwise
equals
(Object
The object to check for equality
other
)

Overrides org.jruby.RubyObject.equals.

We override equals here to provide a faster path, since equality for modules is pretty cut and dried.

public void
exportMethod(String name, Visibility visibility)
Deprecated since 10.0.

private void
exportMethod(ThreadContext context, String name, Visibility visibility)

rb_export_method

public IRubyObject
extend_object(IRubyObject obj)
Deprecated since 10.0.

public IRubyObject
extend_object(ThreadContext context, IRubyObject obj)

rb_mod_extend_object

public IRubyObject
extended(ThreadContext context, IRubyObject other, Block block)

public IRubyObject
fastFetchClassVariable(String internedName)
Deprecated

public IRubyObject
fastFetchConstant(String internedName)
Deprecated

public RubyClass
fastGetClass(String internedName)
Deprecated

public IRubyObject
fastGetClassVar(String internedName)
Deprecated

public IRubyObject
fastGetConstant(String internedName)
Deprecated

public IRubyObject
fastGetConstant(String internedName, boolean inherit)
Deprecated

public IRubyObject
fastGetConstantAt(String internedName)
Deprecated

public IRubyObject
fastGetConstantFrom(String internedName)
Deprecated

public IRubyObject
fastGetConstantFromConstMissing(String internedName)
Deprecated

public IRubyObject
fastGetConstantFromNoConstMissing(String internedName)
Deprecated

public boolean
fastHasClassVariable(String internedName)
Deprecated

public boolean
fastHasConstant(String internedName)
Deprecated

public boolean
fastIsClassVarDefined(String internedName)
Deprecated

public boolean
fastIsConstantDefined(String internedName)
Deprecated

public IRubyObject
fastSetClassVar(final String internedName, final IRubyObject value)
Deprecated

public IRubyObject
fastSetConstant(String internedName, IRubyObject value)
Deprecated since 9.4-.

public IRubyObject
fastStoreClassVariable(String internedName, IRubyObject value)
Deprecated

public IRubyObject
fastStoreConstant(String internedName, IRubyObject value)
Deprecated

public IRubyObject
public IRubyObject
fetchConstant(String name)
Deprecated since 10.0.

public IRubyObject
public IRubyObject
fetchConstant(String name, boolean includePrivate)
Deprecated since 10.0.

public IRubyObject
fetchConstant(ThreadContext context, String name, boolean includePrivate)

public RubyModule.ConstantEntry
fetchConstantEntry(String name, boolean includePrivate)
Deprecated since 10.0.

public RubyModule.ConstantEntry

Returns:

the entry for the constant.
fetchConstantEntry
(ThreadContext context, String
of the constant.
name
,
boolean
include private/hidden constants
includePrivate
)

The equivalent for fetchConstant but is useful for extra state like whether the constant is private or not.

public RubyModule

Returns:

The method, or UndefinedMethod if not found
findImplementer
(RubyModule
the class to find
clazz
)

Find the given class in this hierarchy, considering modules along the way.

pack-priv IncludedModuleWrapper
private static RubyModule
protected final IRubyObject
finishAutoload(String name)
Deprecated since 10.0.

protected final IRubyObject
finishAutoload(ThreadContext context, String name)

Extract an Object which is defined by autoload thread from autoloadMap and define it as a constant.

public static void
public static void
public static void
public final IRubyObject
freeze(ThreadContext context)

Overrides org.jruby.RubyBasicObject.freeze.

rb_mod_freeze

private String
private List<RubyModule>

Returns:

A list of all modules that would be included by including the given module
gatherModules
(RubyModule
The base module from which to aggregate modules
baseModule
)

Gather all modules that would be included by including the given module.

public List<IRubyObject>
public final IRubyObject
getAutoloadConstant(String name)
Deprecated since 10.0.

public final IRubyObject
getAutoloadConstant(ThreadContext context, String name)

Get autoload constant.

protected IRubyObject
getAutoloadConstant(String name, boolean loadConstant)
Deprecated since 10.0.

protected IRubyObject
getAutoloadConstant(ThreadContext context, String name, boolean loadConstant)

protected RubyString
protected Map<String, RubyModule.Autoload>
getAutoloadMap()

AutoloadMap must be accessed after checking ConstantMap.

protected Map<String, RubyModule.Autoload>
public String

Returns:

base name of the class
getBaseName
()

Get the base name of this class, or null if it is an anonymous class.

protected final Map<String, CacheEntry>
private final Map<String, CacheEntry>
public boolean
getCacheProxy()

Get whether this Java proxy class should try to keep its instances idempotent and alive using the ObjectProxyCache.

public final int
getCacheToken()
Deprecated

public RubyClass
getClass(String name)
Deprecated since 10.0.

public RubyClass

Returns:

the class or null if no such class
getClass
(ThreadContext
the current thread context
context
,
String
to be found in this module (or class)
name
)

Finds a class that is within the current module/class.

public ClassIndex
getClassIndex()

Get the ClassIndex for this class.

private Set<ClassProvider>

Returns:

the class provider set or an empty set if there are no class providers
getClassProvidersForRead
()

Return the class providers set for read operations.

private Set<ClassProvider>

Returns:

the class provider set suitable for updating
getClassProvidersForWrite
()

Return the class providers set for write operations.

public IRubyObject
getClassVar(String name)
Deprecated since 10.0.

public IRubyObject

Returns:

The variable's value, or throws NameError if not found
getClassVar
(ThreadContext context, String
The name of the variable to retrieve
name
)

Retrieve the specified class variable, searching through this module, included modules, and supermodules.

public IRubyObject
getClassVar(IRubyObject nameObject, String name)
Deprecated since 10.0.

public IRubyObject
getClassVar(ThreadContext context, IRubyObject nameObject, String name)

public List<String>
protected Map<String, IRubyObject>
protected Map<String, IRubyObject>
private Map<String, IRubyObject>

Returns:

the class vars map, ready for assignment
getClassVariablesForWrite
()

Get the class variables for write.

public IRubyObject
getClassVarQuiet(String name)
Deprecated since 10.0.

private IRubyObject
public IRubyObject
getConstant(String name)
Deprecated since 10.0.

public IRubyObject

Returns:

The value for the constant, or null if not found
getConstant
(ThreadContext context, String
The constant to retrieve
name
)

Retrieve the named constant, invoking 'const_missing' should that be appropriate.

public IRubyObject
getConstant(String name, boolean inherit)
Deprecated since 10.0.

public IRubyObject
getConstant(ThreadContext context, String name, boolean inherit)

public IRubyObject
getConstant(String name, boolean inherit, boolean includeObject)
Deprecated since 10.0.

public IRubyObject
getConstant(ThreadContext context, String name, boolean inherit, boolean includeObject)

public IRubyObject
getConstantAt(String name)
Deprecated since 10.0.

public IRubyObject
public IRubyObject
getConstantAt(String name, boolean includePrivate)
Deprecated since 10.0.

public IRubyObject
getConstantAt(ThreadContext context, String name, boolean includePrivate)

public IRubyObject
getConstantAtSpecial(String name)
Deprecated since 10.0.

public IRubyObject

Returns:

the constant, or null if it was not found
getConstantAtSpecial
(ThreadContext context, String
the constant name to find
name
)

This version searches superclasses if we're starting with Object.

public IRubyObject
getConstantFrom(String name)
Deprecated since 10.0.

public IRubyObject
public IRubyObject
getConstantFromConstMissing(String name)
Deprecated since 10.0.

public IRubyObject
public IRubyObject
getConstantFromNoConstMissing(String name)
Deprecated since 10.0.

public IRubyObject
public IRubyObject
getConstantFromNoConstMissing(String name, boolean includePrivate)
Deprecated since 10.0.

public IRubyObject
getConstantFromNoConstMissing(ThreadContext context, String name, boolean includePrivate)

public Map<String, RubyModule.ConstantEntry>
public Map<String, RubyModule.ConstantEntry>
public Collection<String>

Returns:

a list of constant names that exists at time this was called
getConstantNames
()

public Collection<String>
getConstantNames(boolean includePrivate)

public IRubyObject
getConstantNoConstMissing(String name)
Deprecated since 10.0.

public IRubyObject
public IRubyObject
getConstantNoConstMissing(String name, boolean inherit)
Deprecated since 10.0.

public IRubyObject
getConstantNoConstMissing(ThreadContext context, String name, boolean inherit)

public IRubyObject
getConstantNoConstMissing(String name, boolean inherit, boolean includeObject)
Deprecated since 10.0.

public IRubyObject
getConstantNoConstMissing(ThreadContext context, String name, boolean inherit, boolean includeObject)

public final IRubyObject
getConstantNoConstMissingSkipAutoload(String name)
Deprecated since 10.0.

public final IRubyObject
public IRubyObject
private IRubyObject
getConstantSkipAutoload(ThreadContext context, String name, boolean inherit, boolean includeObject)

public RubyModule.SourceLocation
getConstantSourceLocation(String name, boolean inherit, boolean includeObject)
Deprecated since 10.0.

public RubyModule.SourceLocation
getConstantSourceLocation(ThreadContext context, String name, boolean inherit, boolean includeObject)

public IRubyObject
getConstantWithAutoload(String name, IRubyObject failedAutoloadValue, boolean includePrivate)
Deprecated since 10.0.

public IRubyObject
getConstantWithAutoload(ThreadContext context, String name, IRubyObject failedAutoloadValue, boolean includePrivate)

Search just this class for a constant value, or trigger autoloading.

private Visibility
public RubyModule
public final int
public final Integer
public final MethodHandle
private RubyClass.RubyClassSet
protected RubyClass.RubyClassSet
public Invalidator
public boolean
getJavaProxy()

Get whether this class is associated with (i.e. a proxy for) a normal Java class or interface.

public RubyModule
public Map<String, DynamicMethod>
public Map<String, DynamicMethod>
public RubyModule
getModule(String name)
Deprecated since 10.0.

public RubyModule

Returns:

the module or null if no such module
getModule
(ThreadContext context, String
to be found in this module (or class)
name
)

Finds a module that is within the current module (or class).

public String
getName()
Deprecated since 10.0.

public String

Returns:

The generated class name
getName
(ThreadContext context)

Generate a fully-qualified class name or a #-style name for anonymous and singleton classes.

public ClassIndex
getNativeClassIndex()

Overrides org.jruby.RubyObject.getNativeClassIndex.

Implements org.jruby.runtime.marshal.CoreObjectType.getNativeClassIndex.

This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.

public RubyModule
getNonIncludedClass()
Deprecated

public RubyModule

Returns:

the actual module of an included/prepended module.
getOrigin
()

In an included or prepended module what is the ACTUAL module it represents?

public RubyModule
private RubyModule
public RubyModule

Returns:

the nearest non-singleton non-include module in the hierarchy
getRealModule
()

Get the "real" module, either the current one or the nearest ancestor that is not a singleton or include wrapper.

private IRubyObject
getRefinedClassOrThrow(ThreadContext context, boolean nameIsTarget)

public Map<RubyModule, RubyModule>
public Map<RubyModule, RubyModule>
pack-priv RubyModule.RefinementStore
public String
getSimpleName()
Deprecated since 10.0.

public String

Returns:

the "simple" name of the class
getSimpleName
(ThreadContext context)

Get the "simple" name for the class, which is either the "base" name or the "anonymous" class name.

public List<Variable<IRubyObject>>
getStoredConstantList()
Deprecated

public List<String>
public RubyClass

Returns:

Value of property superClass.
getSuperClass
()

Getter for property superClass.

public boolean
public IRubyObject
hasAutoload(ThreadContext context, String idString, boolean inherit)

public boolean
public boolean
private boolean
public RubyFixnum
hash(ThreadContext
the current thread context
context
)

Overrides org.jruby.RubyBasicObject.hash.

Will return the hash code of this object.

public int
hashCode()

Overrides org.jruby.RubyObject.hashCode.

This override does not do "checked" dispatch since Object usually has #hash defined.

public boolean

Returns:

the value of the specified internal variable if found, else null
hasInternalModuleVariable
(final String
the internal variable name
name
)

Behaves similarly to getClassVar(ThreadContext, String).

public boolean
public boolean
public boolean
public <T extends RubyModule> T

Returns:

itself for composable API
include
(ThreadContext context, RubyModule
to be included
module
)

In Defining this type include a module.

public RubyModule
include(IRubyObject[] modules)
Deprecated

public RubyModule
include(ThreadContext context, IRubyObject[] modules)

rb_mod_include

public RubyModule
public IRubyObject
public IRubyObject
public RubyArray<T extends IRubyObject>
included_modules(ThreadContext context)

rb_mod_included_modules

public synchronized void
includeModule(IRubyObject arg)
Deprecated since 10.0.

public synchronized void
includeModule(ThreadContext context, IRubyObject
The module to include
arg
)

Include a new module in this module or class.

public IRubyObject
initialize(ThreadContext context, Block block)

rb_mod_initialize

public IRubyObject
initialize(Block block)
Deprecated

public IRubyObject
initialize_copy(ThreadContext
the thread context
context
,
IRubyObject
the original
original
)

Overrides org.jruby.RubyBasicObject.initialize_copy.

mri: rb_mod_init_copy

public IRubyObject
public IRubyObject
instance_method(IRubyObject symbol)
Deprecated since 10.0.

private RubyArray<T extends IRubyObject>

Returns:

a RubyArray of instance method names
instance_methods
(IRubyObject[]
passed into one of the Ruby instance_method methods
args
,
Visibility
to find matching instance methods against
visibility
,
boolean
if true only find methods not matching supplied visibility
not
)
Deprecated since 10.0.

Get a list of all instance methods names of the provided visibility unless not is true, then getService all methods which are not the provided

public RubyArray<?>
instance_methods(IRubyObject[] args)
Deprecated

public RubyArray<T extends IRubyObject>
public RubyArray<?>
instance_methods19(IRubyObject[] args)
Deprecated

public RubyArray<T extends IRubyObject>
instanceMethods(IRubyObject[] args, Visibility visibility, boolean obj, boolean not)
Deprecated since 10.0.

public RubyArray<T extends IRubyObject>
instanceMethods(ThreadContext context, IRubyObject[] args, Visibility visibility, boolean obj, boolean not)

public RubyArray<T extends IRubyObject>
instanceMethods(Visibility visibility, boolean includeSuper, boolean obj, boolean not)
Deprecated since 10.0.

private RubyArray<T extends IRubyObject>
instanceMethods(ThreadContext context, Visibility visibility, boolean includeSuper, boolean obj, boolean not)

public void
invalidateCacheDescendants()
Deprecated since 10.0.

public void
protected void
invalidateConstantCache(String constantName)
Deprecated since 10.0.

protected void
private void
protected void
invalidateConstantCaches(Set<String> constantNames)
Deprecated since 10.0.

protected void
invalidateCoreClasses()
Deprecated since 10.0.

public boolean
isClass()

Overrides org.jruby.RubyBasicObject.isClass.

Implements org.jruby.runtime.builtin.IRubyObject.isClass.

Specifically polymorphic method that are meant to be overridden by classes to specify that they are classes in an easy way.

public boolean

Returns:

true if true, false if false
isClassVarDefined
(String
The class var to determine "is defined?"
name
)

Is class var defined?

public boolean
isConstantDefined(String name, boolean inherit)
Deprecated since 10.0.

public boolean
isConstantDefined(String name)
Deprecated since 10.0.

public boolean
public boolean
isIncluded()

Is this module one that in an included one (e.g. an IncludedModuleWrapper).

public boolean
public boolean
public boolean
public boolean
isMethodBound(String name, boolean checkVisibility)

MRI: rb_method_boundp

public boolean
isMethodBound(String name, boolean checkVisibility, boolean checkRespondTo)
Deprecated

public boolean
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.

public boolean
isModule()

Overrides org.jruby.RubyBasicObject.isModule.

Implements org.jruby.runtime.builtin.IRubyObject.isModule.

Specifically polymorphic method that are meant to be overridden by modules to specify that they are modules in an easy way.

public boolean
public boolean
private boolean
isReifiable(RubyClass Object, RubyClass superClass)

Determine if a new child of the given class can have its variables reified.

protected boolean
protected boolean
public boolean
public boolean
public static boolean
isValidConstantName(ByteList bytelist, int start, int end)

public static boolean
private static RubyModule.SourceLocation
private static IRubyObject
iterateConstantNoConstMissing(ThreadContext context, String name, RubyModule init, boolean inherit, boolean loadConstant)

public <
class or module types
T extends RubyModule
>
T

Returns:

itself for composblae API
kindOf
(RubyModule.KindOf
method to determine kind-of status
kindOf
)

Set the method for determining whether an Object is a kind of the supplied type.

public static TypePopulator
public static void
marshalTo(RubyModule module, MarshalStream output)
Deprecated for removal since 10.0.

public static void
public IRubyObject
public RubyBoolean
public RubyBoolean
method_defined_p(ThreadContext context, IRubyObject symbol, IRubyObject includeSuper)

public IRubyObject
public IRubyObject
protected void
methodAdded(ThreadContext context, RubySymbol identifier)

private void
private void
public IRubyObject
mix(ThreadContext context, IRubyObject modArg)

public IRubyObject
mix(ThreadContext context, IRubyObject modArg, IRubyObject hash0)

public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
module_eval(ThreadContext context, IRubyObject[] args, Block block)

public IRubyObject
public IRubyObject
module_exec(ThreadContext context, IRubyObject[] args, Block block)

public IRubyObject
public IRubyObject
name()
Deprecated since 10.0.

public IRubyObject
public boolean
public static RubyArray<T extends IRubyObject>
nesting(ThreadContext context, IRubyObject recv, Block block)

Return an array of nested modules or classes.

public static Map<RubyModule, IncludedModule>
protected final MethodHandle
public IncludedModuleWrapper

Returns:

The module wrapper
newIncludeClass
(RubyClass superClazz)
Deprecated

Create a wrapper to use for including the specified module into this one.

public final IRubyObject
newMethod(IRubyObject receiver, String methodName, boolean bound, Visibility visibility)
Deprecated since 10.0.

public final IRubyObject
newMethod(IRubyObject receiver, String methodName, StaticScope refinedScope, boolean bound, Visibility visibility)
Deprecated since 10.0.

public final IRubyObject
newMethod(IRubyObject receiver, final String methodName, boolean bound, Visibility visibility, boolean respondToMissing)
Deprecated since 10.0.

public final IRubyObject
newMethod(IRubyObject receiver, final String methodName, StaticScope scope, boolean bound, Visibility visibility, boolean respondToMissing)
Deprecated since 10.0.

public IRubyObject
newMethod(IRubyObject receiver, final String methodName, boolean bound, Visibility visibility, boolean respondToMissing, boolean priv)
Deprecated since 10.0.

public IRubyObject
newMethod(IRubyObject receiver, final String methodName, StaticScope scope, boolean bound, Visibility visibility, boolean respondToMissing, boolean priv)
Deprecated since 10.0.

protected IRubyObject
newMethod(ThreadContext context, IRubyObject receiver, final String methodName, StaticScope scope, boolean bound, Visibility visibility, boolean respondToMissing, boolean priv)

public static RubyModule
newModule(Ruby runtime)
Deprecated since 10.0.

rb_module_new

public static RubyModule
newModule(Ruby runtime, String name, RubyModule parent, boolean setParent, String file, int line)
Deprecated since 10.0.

public static RubyModule
newModule(ThreadContext context, String name, RubyModule parent, boolean setParent, String file, int line)

rb_module_new/rb_define_module_id/rb_name_class/rb_set_class_path This is used by IR to define a new module.

public static RubyModule
newModule(Ruby runtime, String name, RubyModule parent, boolean setParent)
Deprecated since 10.0.

public static RubyModule
newModuleBootstrap(Ruby runtime, String name, RubyModule parent)

public static Map<RubyModule, RubyModule>
public static Map<RubyModule, RubyModule>
public IRubyObject
public IRubyObject
op_cmp(IRubyObject obj)
Deprecated

public RubyBoolean
public IRubyObject
op_equal(ThreadContext context, IRubyObject other)

Overrides org.jruby.RubyBasicObject.op_equal.

Implements org.jruby.runtime.builtin.IRubyObject.op_equal.

rb_obj_equal Will by default use identity equality to compare objects.

public IRubyObject
op_ge(IRubyObject obj)
Deprecated since 10.0.

public IRubyObject
op_ge(ThreadContext context, IRubyObject obj)

rb_mod_ge

public IRubyObject
op_gt(IRubyObject obj)
Deprecated since 10.0.

public IRubyObject
op_gt(ThreadContext context, IRubyObject obj)

rb_mod_gt

public IRubyObject
op_le(IRubyObject arg)
Deprecated since 10.0.

public IRubyObject
op_le(ThreadContext context, IRubyObject arg)

MRI: rb_class_inherited_p

public IRubyObject
op_lt(IRubyObject obj)
Deprecated since 10.0.

public IRubyObject
op_lt(ThreadContext context, IRubyObject obj)

rb_mod_lt

pack-priv final void
populateInstanceMethodNames(ThreadContext context, final Set<String> seen, final RubyArray<T extends IRubyObject> ary, Visibility visibility, boolean obj, boolean not, boolean recur)

public IRubyObject
prepend(ThreadContext context, IRubyObject[] modules)

public RubyModule
prepend_features(IRubyObject include)
Deprecated since 10.0.

public RubyModule
prepend_features(ThreadContext context, IRubyObject include)

rb_mod_prepend_features

public IRubyObject
public void
prependModule(RubyModule module)
Deprecated since 10.0.

public void
prependModule(ThreadContext context, RubyModule
The module to include
module
)

Prepend a new module to this module or class.

public void
prependModule(IRubyObject arg)
Deprecated

public RubyModule
private_class_method(IRubyObject[] args)
Deprecated since 10.0.

public RubyModule
public IRubyObject
public IRubyObject
public RubyArray<T extends IRubyObject>
public RubyArray<T extends IRubyObject>
private_instance_methods(ThreadContext context, IRubyObject[] args)

rb_class_private_instance_methods

public IRubyObject
public IRubyObject
private RubyModule

Returns:

The new module wrapper resulting from this include
proceedWithInclude
(ThreadContext
the current thread context
context
,
RubyModule
The hierarchy target above which to include the wrapped module
insertAbove
,
RubyModule
The module to wrap and include
moduleToInclude
)

Actually proceed with including the specified module above the given target in a hierarchy.

private RubyModule

Returns:

The new module wrapper resulting from this prepend
proceedWithPrepend
(ThreadContext context, RubyModule
The hierarchy target below which to include the wrapped module
insertBelow
,
RubyModule
The module to wrap and prepend
moduleToPrepend
)

Actually proceed with prepending the specified module below the given target in a hierarchy.

public RubyArray<T extends IRubyObject>
public RubyArray<T extends IRubyObject>
protected_instance_methods(ThreadContext context, IRubyObject[] args)

rb_class_protected_instance_methods

public IRubyObject
public IRubyObject
public RubyModule
public_class_method(IRubyObject[] args)
Deprecated since 10.0.

public RubyModule
public IRubyObject
public IRubyObject
public IRubyObject
public_instance_method(IRubyObject symbol)
Deprecated since 10.0.

public IRubyObject
public RubyArray<?>
public RubyArray<T extends IRubyObject>
public RubyArray<?>
public IRubyObject
public IRubyObject
public boolean
publicConstDefinedFrom(String name)
Deprecated since 10.0.

public boolean
public void
putAlias(String id, DynamicMethod method, String oldName)
Deprecated since 10.0.

public void
putAlias(ThreadContext context, String id, DynamicMethod method, String oldName)

Note

Not safe for target methods that super, since the frame class will not reflect original source.

public void
putAlias(String id, CacheEntry entry, String oldName)
Deprecated since 10.0.

public void
putAlias(ThreadContext context, String id, CacheEntry entry, String oldName)

Alias the method contained in the given CacheEntry as a new entry in this module.

public DynamicMethod
putMethod(Ruby runtime, String id, DynamicMethod method)
Deprecated since 10.0.

public DynamicMethod

Returns:

method
putMethod
(ThreadContext
the current thread context
context
,
String
identifier string (8859_1). Matching entry in symbol table.
id
,
DynamicMethod method)

Note

Internal API - only public as its used by generated code!

private void
public IRubyObject
rbPrivate(ThreadContext context, IRubyObject[] args)
Deprecated

public IRubyObject
rbProtected(ThreadContext context, IRubyObject[] args)
Deprecated

public IRubyObject
rbPublic(ThreadContext context, IRubyObject[] args)
Deprecated

public IRubyObject
refine(ThreadContext context, IRubyObject klass, Block block)

public IRubyObject
refined_class(ThreadContext context)
Deprecated since 10.0.

private CacheEntry
refinedMethodOriginalMethodEntry(RubyModule overlay, String id, boolean cacheUndef, CacheEntry entry)

public IRubyObject
private static RubyClass
public IRubyObject
remove_class_variable(ThreadContext context, IRubyObject name)

rb_mod_remove_cvar

public IRubyObject
public IRubyObject
public RubyModule
private void
removeAutoload(String name)

Removes an Autoload object from autoloadMap.

public final synchronized void
public IRubyObject
removeClassVariable(String name)
Deprecated since 10.0.

public IRubyObject
public void
public CacheEntry
resolveRefinedMethod(RubyModule overlay, CacheEntry entry, String id, boolean cacheUndef)

public final IRubyObject
resolveUndefConstant(String name)
Deprecated since 10.0.

pack-priv IRubyObject
public boolean
respondsToMethod(String name, boolean checkVisibility, StaticScope scope)

public boolean
respondsToMethod(String name, boolean checkVisibility)

public DynamicMethod

Returns:

The method, or UndefinedMethod if not found
retrieveMethod
(String
The name of the method to search for
name
)

Search through this module and supermodules for method definitions.

public IRubyObject
public RubyString
rubyBaseName()
Deprecated since 10.0.

public RubyString
public RubyString
rubyName()
Deprecated since 10.0.

public RubyString

Returns:

a properly encoded class name.

Note

getId() is only really valid for ASCII values. This should be favored over using it.

rubyName
(ThreadContext context)

Generate a fully-qualified class name or a #-style name for anonymous and singleton classes which is properly encoded.

protected RubyModule
private CacheEntry
public IRubyObject

Returns:

the value of the specified internal variable if found, else null
searchInternalModuleVariable
(final String
the internal variable name
name
)

Behaves similarly to getClassVar(ThreadContext, String).

public final DynamicMethod

Returns:

The method, or UndefinedMethod if not found
searchMethod
(String
The name of the method to search for
name
)

Search through this module and supermodules for method definitions.

protected DynamicMethod
public CacheEntry
public DynamicMethod
public DynamicMethod
searchMethodLateral(String id)
Deprecated

Searches for a method up until the superclass, but include modules.

private RubyClass
private RubyModule
public CacheEntry

Returns:

the CacheEntry corresponding to the method and this class's serial number
searchWithCache
(String
the method name
name
)

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.

public final CacheEntry

Returns:

The method, or UndefinedMethod if not found
searchWithCache
(String
The name of the method to search for
id
,
boolean
Flag for caching UndefinedMethod. This should normally be true.
cacheUndef
)

Search through this module and supermodules for method definitions.

private CacheEntry
searchWithCacheAndRefinements(String id, boolean cacheUndef, StaticScope refinedScope)

private CacheEntry

Returns:

The method, or UndefinedMethod if not found
searchWithCacheMiss
(Ruby runtime, final String
The name of the method to search for
id
,
final boolean
Flag for caching UndefinedMethod. This should normally be true.
cacheUndef
)

Search through this module and supermodules for method definitions after RubyModule#cacheHit(String) failed to return a result.

public CacheEntry

Returns:

the method or UndefinedMethod
searchWithRefinements
(String
the method name
name
,
StaticScope
the scope containing refinements to search
refinedScope
)

Search for the named method in this class and in superclasses applying refinements from the given scope.

public IRubyObject
private boolean
setAutoloadConstant(ThreadContext context, String name, IRubyObject value, String file, int line)

Set an Object as a defined constant in autoloading.

public void
setBaseName(String
the new base name of the class
name
)
Deprecated since 10.0. Use org.jruby.RubyModule#baseName(String) instead.

Set the base name of the class.

public void
setCacheProxy(boolean cacheProxy)

Set whether this Java proxy class should try to keep its instances idempotent and alive using the ObjectProxyCache.

pack-priv void
setClassIndex(ClassIndex
the ClassIndex for this type
classIndex
)
Deprecated since 10.0. Use org.jruby.RubyModule#classIndex(ClassIndex) instead.

Set the ClassIndex for this core class.

public IRubyObject
setClassVar(String name, IRubyObject value)
Deprecated since 10.0.

public IRubyObject
setClassVar(ThreadContext context, String
The variable name to set
name
,
IRubyObject
The value to set it to
value
)

Set the named class variable to the given value, provided freeze allows setting it.

public IRubyObject
setConstant(String name, IRubyObject value)
Deprecated since 10.0.

public IRubyObject

Returns:

The result of setting the variable.
setConstant
(ThreadContext context, String
The name to assign
name
,
IRubyObject
The value to assign to it; if an unnamed Module, also set its basename to name
value
)

Set the named constant on this module.

public IRubyObject
setConstant(String name, IRubyObject value, String file, int line)
Deprecated since 10.0.

public IRubyObject
setConstant(ThreadContext context, String name, IRubyObject value, String file, int line)

public IRubyObject
setConstant(String name, IRubyObject value, boolean hidden)
Deprecated since 10.0.

public IRubyObject
setConstant(ThreadContext context, String name, IRubyObject value, boolean hidden)

private IRubyObject

Returns:

The result of setting the variable.
setConstantCommon
(ThreadContext context, String
The name to assign
name
,
IRubyObject
The value to assign to it; if an unnamed Module, also set its basename to name
value
,
boolean
whether a constant is private (hidden). This parameter is only for asserting it is explicitly private. If it is false the entry may still remain private if the constant was already private and its value is being updated.
hidden
,
boolean warn, String file, int line)

Set the named constant on this module.

public IRubyObject
setConstantQuiet(String name, IRubyObject value)
Deprecated since 10.0.

public IRubyObject

Returns:

The result of setting the variable.
setConstantQuiet
(ThreadContext context, String
The name to assign
name
,
IRubyObject
The value to assign to it; if an unnamed Module, also set its basename to name
value
)

Set the named constant on this module.

public final void
setConstantVisibility(Ruby runtime, String name, boolean hidden)
Deprecated since 10.0.

public final void
setConstantVisibility(ThreadContext context, String name, boolean hidden)

public void
setInternalModuleVariable(final String
the internal variable name
name
,
final IRubyObject
the internal variable value
value
)

Behaves similarly to setClassVar(ThreadContext, String, IRubyObject).

public void
setJavaProxy(boolean javaProxy)

Set whether this class is associated with (i.e. a proxy for) a normal Java class or interface.

public void
public void
setMethodVisibility(IRubyObject[] methods, Visibility visibility)
Deprecated since 10.0.

public void
setMethodVisibility(ThreadContext context, IRubyObject[] methods, Visibility visibility)

set_method_visibility

public void
private void
setParentForModule(ThreadContext context, final String name, final IRubyObject value)

public void
public void
setSuperClass(RubyClass superClass)
Deprecated since 10.0. Use RubyModule#superClass(RubyClass) instead.

private void
setVisibility(ThreadContext context, IRubyObject[] args, Visibility visibility)

public IRubyObject
public IRubyObject
storeClassVariable(String name, IRubyObject value)
Deprecated since 10.0.

public IRubyObject
public IRubyObject
storeConstant(String name, IRubyObject value)
Deprecated since 10.0.

public IRubyObject
public IRubyObject
storeConstant(String name, IRubyObject value, boolean hidden, String file, int line)
Deprecated since 10.0.

public IRubyObject
storeConstant(ThreadContext context, String name, IRubyObject value, boolean hidden, String file, int line)

public IRubyObject
storeConstant(String name, IRubyObject value, boolean hidden)
Deprecated since 10.0.

private IRubyObject
storeConstant(ThreadContext context, String name, IRubyObject value, boolean hidden, boolean deprecated)

public RubyClass

Returns:

the super class
superClass
()

Get this module/class super class.

public <
class or module type
T extends RubyModule
>
T

Returns:

itself for composable API
superClass
(RubyClass
to be set
superClass
)

Set this module/class super class.

public RubySymbol
symbolName()
Deprecated since 10.0.

public RubySymbol

Returns:

a properly encoded non-anonymous class path as a Symbol, or null.
symbolName
(ThreadContext context)

Generate a fully-qualified class name or a #-style name as a Symbol.

public void
public void
public <
A module or class
T extends RubyModule
>
T

Returns:

this
tap
(Consumer<T>
to be given this
consumer
)

Provide itself to a lambda then return itself.

public IRubyObject
public static boolean
testModuleMatch(ThreadContext context, IRubyObject arg0, int id)

public RubyString
public IRubyObject
to_s(ThreadContext context)

Overrides org.jruby.RubyBasicObject.to_s.

rb_mod_to_s

public <T> T
toJava(Class<T>
The target type to which the object should be converted.
target
)

Overrides org.jruby.RubyBasicObject.toJava.

Implements org.jruby.runtime.builtin.IRubyObject.toJava.

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

public void
undef(ThreadContext context, String name)

rb_undef

public RubyModule
public IRubyObject
public static String
undefinedMethodMessage(Ruby runtime, IRubyObject name, IRubyObject modName, boolean isModule)

public void
public <T extends RubyModule> T

Returns:

this type for composable API
undefMethods
(ThreadContext context, String...
the methods to undefine
names
)

Undefine a method from this type.

public static RubyModule
unmarshalFrom(UnmarshalStream input)
Deprecated for removal since 10.0.

public static RubyModule
public void
private void
updateGeneration(final Ruby runtime)

public IRubyObject
public IRubyObject
public IRubyObject
using(ThreadContext context, IRubyObject refinedModule)

public static void
usingModule(ThreadContext context, RubyModule cref, IRubyObject refinedModule)

private static void
private static void
public boolean
protected final String
validateClassVariable(String name)
Deprecated since 10.0.

private String
protected final String
validateClassVariable(IRubyObject nameObj, String name)
Deprecated since 10.0.

protected String
validateClassVariable(Ruby runtime, IRubyObject object)
Deprecated since 10.0.

protected String
protected final String
validateConstant(IRubyObject name)
Deprecated since 10.0.

protected final String

Returns:

the id for this valid constant name.
validateConstant
(ThreadContext context, IRubyObject
object to verify as a valid constant.
name
)

Validates name is a valid constant name and returns its id string.

protected final String
validateConstant(String name, IRubyObject errorName)
Deprecated since 10.0.

private final String
private RubyModule
private static void
warnMethodRemoval(final ThreadContext context, final String id)

private void
yieldRefineBlock(ThreadContext context, RubyModule refinement, Block block)

Inherited from org.jruby.RubyObject:
attachToObjectSpacecallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitconvertToTypedigdig1dig2eqlInternalequalInternalfinishObjectClassinspectputsspecificEvaltoRubyStringtoString