Package org.jruby
Class RubyModule
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyModule
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<IRubyObject>
,InstanceVariables
,InternalVariables
,IRubyObject
,CoreObjectType
- Direct Known Subclasses:
JavaPackage
,RubyClass
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal class
Objects for holding autoload state for the defined constant.static interface
Deprecated.protected static class
static class
Represents a constant value, possibly hidden (private).static class
static final class
static class
static final class
static class
Deprecated.protected static class
static class
static class
static interface
protected static class
protected static class
A wrapper CacheEntryFactory, for delegating cache entry creation along a chain.Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.Data
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
The base name of this class/module, excluding nesting.static final String
protected Map
<String, CacheEntry> static final int
protected ClassIndex
protected int
protected Integer
final int
static final int
protected org.jruby.RubyClass.RubyClassSet
int
Deprecated.use RubyModule#getClassIndex()static final int
protected final Invalidator
protected RubyModule
Where are the methods of this module/class located? This only happens as a result of prepend (see PrependedModule) where it moves all methods to a PrependedModule which will be beneath the actual module which was prepended.protected Map
<String, DynamicMethod> static final ObjectAllocator
static final int
protected static final RubyModule.CacheEntryFactory
static final int
The class/module within whose namespace this class/module resides.static final int
Deprecated.protected RubyClass
static final int
Fields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR
Fields inherited from class org.jruby.RubyBasicObject
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, STAMP_OFFSET, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_F, VAR_TABLE_OFFSET, varTable, varTableStamp
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionRubyModule
(Ruby runtime) standard path for Module constructionprotected
RubyModule
(Ruby runtime, RubyClass metaClass) used by MODULE_ALLOCATOR and RubyClass constructorsprotected
RubyModule
(Ruby runtime, RubyClass metaClass, boolean objectSpace) separate path for MetaClass construction -
Method Summary
Modifier and TypeMethodDescription_module_function
(ThreadContext context, IRubyObject[] args) rb_mod_modfunc_private
(ThreadContext context, IRubyObject[] args) rb_mod_private_protected
(ThreadContext context, IRubyObject[] args) rb_mod_protected_public
(ThreadContext context, IRubyObject[] args) rb_mod_publicfinal void
addClassProvider
(ClassProvider provider) void
addIncludingHierarchy
(IncludedModule hierarchy) void
addMethod
(String id, DynamicMethod method) Deprecated.void
addMethod
(ThreadContext context, String id, DynamicMethod method) final void
addMethodInternal
(String name, DynamicMethod method) Deprecated.final void
addMethodInternal
(ThreadContext context, String name, DynamicMethod method) protected void
addMethodSymbols
(Ruby runtime, Set<String> seen, RubyArray ary, boolean not, Visibility visibility) Deprecated.protected void
addMethodSymbols
(ThreadContext context, Set<String> seen, RubyArray ary, boolean not, Visibility visibility) void
addModuleFunction
(String name, DynamicMethod method) Deprecated.void
addReadAttribute
(ThreadContext context, String name) void
addReadWriteAttribute
(ThreadContext context, String name) protected CacheEntry
addToCache
(String id, DynamicMethod method, RubyModule sourceModule, int token) protected CacheEntry
addToCache
(String id, CacheEntry entry) void
addWriteAttribute
(ThreadContext context, String name) alias_method
(ThreadContext context, IRubyObject newId, IRubyObject oldId) Old version ofaliasMethod(ThreadContext, IRubyObject, IRubyObject)
that returns this module.aliasMethod
(ThreadContext context, IRubyObject newId, IRubyObject oldId) Add an alias under the name newId pointing at the method under the name oldId.Deprecated.ancestors
(ThreadContext context) rb_mod_ancestorsappend_features
(IRubyObject include) Deprecated.append_features
(ThreadContext context, IRubyObject include) rb_mod_append_featuresattr
(ThreadContext context, IRubyObject[] args) rb_mod_attrattr_accessor
(IRubyObject[] args) Deprecated.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.attr_reader
(IRubyObject[] args) Deprecated.attr_reader
(ThreadContext context, IRubyObject[] args) rb_mod_attr_readerattr_writer
(ThreadContext context, IRubyObject[] args) rb_mod_attr_writerautoload
(ThreadContext context, IRubyObject symbol, IRubyObject file) autoload_p
(ThreadContext context, IRubyObject symbol) autoload_p
(ThreadContext context, IRubyObject symbol, IRubyObject inherit) boolean
autoloadingValue
(Ruby runtime, String name) Deprecated.boolean
autoloadingValue
(ThreadContext context, String name) <T extends RubyModule>
TSet the base name of the class.void
protected void
checkForCyclicPrepend
(ThreadContext context, RubyModule m) final void
The actual method that checks frozen with the default frozen message from MRI.void
checkValidBindTargetFrom
(ThreadContext context, RubyModule originModule, boolean fromBind) class_variable_defined_p
(ThreadContext context, IRubyObject var) Deprecated.class_variable_get
(ThreadContext context, IRubyObject name) rb_mod_cvar_getDeprecated.class_variable_set
(IRubyObject name, IRubyObject value) Deprecated.class_variable_set
(ThreadContext context, IRubyObject name, IRubyObject value) rb_mod_cvar_setclass_variable_set19
(IRubyObject name, IRubyObject value) Deprecated.class_variables
(ThreadContext context) class_variables
(ThreadContext context, IRubyObject inherit) <T extends RubyModule>
TclassIndex
(ClassIndex classIndex) Sets the ClassIndex for this typeprotected final IRubyObject
cloneMethods
(RubyModule clone) Deprecated.protected final IRubyObject
cloneMethods
(ThreadContext context, RubyModule clone) const_added
(ThreadContext context, IRubyObject _newConstant) const_defined_p
(ThreadContext context, IRubyObject name) rb_mod_const_definedconst_defined_p
(ThreadContext context, IRubyObject name, IRubyObject recurse) const_get
(IRubyObject symbol) Deprecated.const_get
(ThreadContext context, IRubyObject arg0) const_get
(ThreadContext context, IRubyObject... args) Deprecated.const_get
(ThreadContext context, IRubyObject arg0, IRubyObject arg1) const_get_1_9
(ThreadContext context, IRubyObject[] args) Deprecated.const_get_2_0
(ThreadContext context, IRubyObject[] args) Deprecated.const_missing
(ThreadContext context, IRubyObject rubyName, Block block) Base implementation of Module#const_missing, throws NameError for specific missing constant.const_set
(IRubyObject name, IRubyObject value) Deprecated.const_set
(ThreadContext context, IRubyObject name, IRubyObject value) rb_mod_const_setconst_source_location
(ThreadContext context, IRubyObject[] args) protected RubyModule.ConstantEntry
constantEntryFetch
(String name) constants
(ThreadContext context) constants
(ThreadContext context, IRubyObject allConstants) constantsCommon
(Ruby runtime, boolean replaceModule, boolean allConstants) rb_mod_constantsconstantsCommon
(Ruby runtime, boolean replaceModule, boolean allConstants, boolean includePrivate) protected boolean
constantTableContains
(String name) protected IRubyObject
constantTableFetch
(String name) protected IRubyObject
constantTableRemove
(String name) protected IRubyObject
constantTableStore
(String name, IRubyObject value) protected IRubyObject
constantTableStore
(String name, IRubyObject value, boolean hidden) protected IRubyObject
constantTableStore
(String name, IRubyObject value, boolean hidden, boolean deprecated) protected IRubyObject
constantTableStore
(String name, IRubyObject value, boolean hidden, boolean deprecated, String file, int line) boolean
constDefined
(String name) Deprecated.boolean
constDefined
(ThreadContext context, String name) boolean
constDefinedAt
(String name) Deprecated.boolean
constDefinedAt
(ThreadContext context, String name) boolean
constDefinedFrom
(String name) Deprecated.boolean
constDefinedFrom
(ThreadContext context, String name) define_method
(ThreadContext context, IRubyObject[] args, Block block) Deprecated.define_method
(ThreadContext context, IRubyObject arg0, Block block) define_method
(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) void
defineAlias
(String name, String oldName) Deprecated.<T extends RubyModule>
TdefineAlias
(ThreadContext context, String name, String oldName) Define an alias on this module/class.void
defineAliases
(List<String> aliases, String oldId) Deprecated.final boolean
defineAnnotatedConstant
(Field field) Deprecated.UsedefineAnnotatedConstant(ThreadContext, Field)
instead.final void
defineAnnotatedConstants
(Class clazz) Deprecated.UsedefineConstants(ThreadContext, Class)
instead.void
defineAnnotatedMethod
(Class clazz, String name) Deprecated.UsedefineMethods(ThreadContext, Class[])
and organize your method definitions where you only specify the .class and not needing to add a name as a discriminator.final boolean
defineAnnotatedMethod
(Method method, MethodFactory methodFactory) Deprecated.final boolean
defineAnnotatedMethod
(String name, List<JavaMethodDescriptor> methods, MethodFactory methodFactory) Deprecated.UsedefineMethods(ThreadContext, Class[])
instead and organize your code around all JRubyMethod annotations in that .class being defined.final boolean
defineAnnotatedMethod
(String name, JavaMethodDescriptor desc, MethodFactory methodFactory) Deprecated.final void
defineAnnotatedMethod
(ThreadContext context, String name, List<JavaMethodDescriptor> methods, MethodFactory methodFactory) This is an internal API used by the type populator.void
defineAnnotatedMethods
(Class clazz) Deprecated.UsedefineMethods(ThreadContext, Class[])
instead.final void
Deprecated.protected final void
defineAutoload
(String symbol, RubyString path) Deprecated.protected final void
defineAutoload
(ThreadContext context, String symbol, RubyString path) Define an autoload.defineClassUnder
(String name, RubyClass superClass, ObjectAllocator allocator) Deprecated.<T extends RubyClass>
TdefineClassUnder
(ThreadContext context, String name, RubyClass superClass, ObjectAllocator allocator) Define a Class under this Class/Module.defineClassUnder
(ThreadContext context, String name, RubyClass superClazz, 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.void
defineConstant
(String name, IRubyObject value) Deprecated.<T extends RubyModule>
TdefineConstant
(ThreadContext context, String name, IRubyObject value) Define a constant when you are defining your Ruby class/module.<T extends RubyModule>
TdefineConstant
(ThreadContext context, String name, IRubyObject value, boolean hidden) Define a constant when you are defining your Ruby class/module.void
defineConstantBootstrap
(String name, IRubyObject value) This is an internal API which is only used during runtime creation but BEFORE the first ThreadContext is created.<T extends RubyModule>
TdefineConstants
(ThreadContext context, Class constantSource) Define constant for your module/class with the supplied Class which contains @JRubyMethod annotations.<C extends Enum<C> & jnr.constants.Constant,
T extends RubyModule>
TdefineConstantsFrom
(ThreadContext context, Class<C> enumClass) Define all constants from the given jnr-constants enum which are defined on the current platform.defineMethodFromBlock
(ThreadContext context, IRubyObject arg0, Block block, Visibility visibility) defineMethodFromCallable
(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Visibility visibility) <T extends RubyModule>
TdefineMethods
(ThreadContext context, Class... methodSources) Define methods for your module/class with the supplied Class which contains @JRubyMethod annotations.defineModuleUnder
(String name) Deprecated.defineModuleUnder
(ThreadContext context, String name) Define a module under this module.defineOrGetClassUnder
(String name, RubyClass superClazz) Deprecated.defineOrGetClassUnder
(String name, RubyClass superClazz, String file, int line) Deprecated.defineOrGetClassUnder
(String name, RubyClass superClazz, ObjectAllocator allocator) Deprecated.defineOrGetClassUnder
(String name, RubyClass superClazz, ObjectAllocator allocator, String file, int line) Deprecated.defineOrGetModuleUnder
(String name) Deprecated.defineOrGetModuleUnder
(String name, String file, int line) Deprecated.defineOrGetModuleUnder
(ThreadContext context, String name, String file, int line) deleteClassVariable
(String name) Deprecated.deleteConstant
(String name) Deprecated.deleteConstant
(ThreadContext context, String name) deprecate_constant
(ThreadContext context, IRubyObject name) deprecate_constant
(ThreadContext context, IRubyObject[] names) void
deprecateConstant
(Ruby runtime, String name) Deprecated.void
deprecateConstant
(ThreadContext context, String name) Mark the named constant as deprecated.protected final void
Deprecated.protected final void
Deprecated.boolean
We override equals here to provide a faster path, since equality for modules is pretty cut and dried.void
exportMethod
(String name, Visibility visibility) Deprecated.extend_object
(IRubyObject obj) Deprecated.extend_object
(ThreadContext context, IRubyObject obj) rb_mod_extend_objectextended
(ThreadContext context, IRubyObject other, Block block) fastFetchClassVariable
(String internedName) Deprecated.fastFetchConstant
(String internedName) Deprecated.fastGetClass
(String internedName) Deprecated.fastGetClassVar
(String internedName) Deprecated.fastGetConstant
(String internedName) Deprecated.fastGetConstant
(String internedName, boolean inherit) Deprecated.fastGetConstantAt
(String internedName) Deprecated.fastGetConstantFrom
(String internedName) Deprecated.fastGetConstantFromConstMissing
(String internedName) Deprecated.fastGetConstantFromNoConstMissing
(String internedName) Deprecated.boolean
fastHasClassVariable
(String internedName) Deprecated.boolean
fastHasConstant
(String internedName) Deprecated.boolean
fastIsClassVarDefined
(String internedName) Deprecated.boolean
fastIsConstantDefined
(String internedName) Deprecated.fastSetClassVar
(String internedName, IRubyObject value) Deprecated.fastSetConstant
(String internedName, IRubyObject value) Deprecated.fastStoreClassVariable
(String internedName, IRubyObject value) Deprecated.fastStoreConstant
(String internedName, IRubyObject value) Deprecated.fetchClassVariable
(String name) fetchConstant
(String name) Deprecated.fetchConstant
(String name, boolean includePrivate) Deprecated.fetchConstant
(ThreadContext context, String name) fetchConstant
(ThreadContext context, String name, boolean includePrivate) fetchConstantEntry
(String name, boolean includePrivate) Deprecated.fetchConstantEntry
(ThreadContext context, String name, boolean includePrivate) The equivalent for fetchConstant but is useful for extra state like whether the constant is private or not.findImplementer
(RubyModule clazz) Find the given class in this hierarchy, considering modules along the way.protected final IRubyObject
finishAutoload
(String name) Deprecated.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.static void
finishCreateModuleClass
(ThreadContext context, RubyClass Module) static void
finishModuleClass
(RubyClass Module) static void
finishRefinementClass
(ThreadContext context, RubyClass Refinement) final IRubyObject
freeze
(ThreadContext context) rb_mod_freezefinal IRubyObject
getAutoloadConstant
(String name) Deprecated.protected IRubyObject
getAutoloadConstant
(String name, boolean loadConstant) Deprecated.final IRubyObject
getAutoloadConstant
(ThreadContext context, String name) Get autoload constant.protected IRubyObject
getAutoloadConstant
(ThreadContext context, String name, boolean loadConstant) protected RubyString
getAutoloadFile
(String name) protected Map
<String, RubyModule.Autoload> AutoloadMap must be accessed after checking ConstantMap.protected Map
<String, RubyModule.Autoload> Get the base name of this class, or null if it is an anonymous class.protected final Map
<String, CacheEntry> boolean
Get whether this Java proxy class should try to keep its instances idempotent and alive using the ObjectProxyCache.final int
Deprecated.Deprecated.getClass
(ThreadContext context, String name) Finds a class that is within the current module/class.Get the ClassIndex for this class.getClassVar
(String name) Deprecated.getClassVar
(IRubyObject nameObject, String name) Deprecated.getClassVar
(ThreadContext context, String name) Retrieve the specified class variable, searching through this module, included modules, and supermodules.getClassVar
(ThreadContext context, IRubyObject nameObject, String name) protected Map
<String, IRubyObject> protected Map
<String, IRubyObject> getClassVarQuiet
(String name) Deprecated.getConstant
(String name) Deprecated.getConstant
(String name, boolean inherit) Deprecated.getConstant
(String name, boolean inherit, boolean includeObject) Deprecated.getConstant
(ThreadContext context, String name) Retrieve the named constant, invoking 'const_missing' should that be appropriate.getConstant
(ThreadContext context, String name, boolean inherit) getConstant
(ThreadContext context, String name, boolean inherit, boolean includeObject) getConstantAt
(String name) Deprecated.getConstantAt
(String name, boolean includePrivate) Deprecated.getConstantAt
(ThreadContext context, String name) getConstantAt
(ThreadContext context, String name, boolean includePrivate) getConstantAtSpecial
(String name) Deprecated.getConstantAtSpecial
(ThreadContext context, String name) This version searches superclasses if we're starting with Object.getConstantFrom
(String name) Deprecated.getConstantFrom
(ThreadContext context, String name) Deprecated.getConstantFromConstMissing
(ThreadContext context, String name) Deprecated.getConstantFromNoConstMissing
(String name, boolean includePrivate) Deprecated.getConstantFromNoConstMissing
(ThreadContext context, String name) getConstantFromNoConstMissing
(ThreadContext context, String name, boolean includePrivate) getConstantNames
(boolean includePrivate) Deprecated.getConstantNoConstMissing
(String name, boolean inherit) Deprecated.getConstantNoConstMissing
(String name, boolean inherit, boolean includeObject) Deprecated.getConstantNoConstMissing
(ThreadContext context, String name) getConstantNoConstMissing
(ThreadContext context, String name, boolean inherit) getConstantNoConstMissing
(ThreadContext context, String name, boolean inherit, boolean includeObject) final IRubyObject
Deprecated.final IRubyObject
getConstantNoConstMissingSkipAutoload
(ThreadContext context, String name) Deprecated.getConstantSourceLocation
(String name, boolean inherit, boolean includeObject) Deprecated.getConstantSourceLocation
(ThreadContext context, String name, boolean inherit, boolean includeObject) getConstantWithAutoload
(String name, IRubyObject failedAutoloadValue, boolean includePrivate) Deprecated.getConstantWithAutoload
(ThreadContext context, String name, IRubyObject failedAutoloadValue, boolean includePrivate) Search just this class for a constant value, or trigger autoloading.final int
final Integer
final MethodHandle
protected org.jruby.RubyClass.RubyClassSet
boolean
Get whether this class is associated with (i.e.Deprecated.getModule
(ThreadContext context, String name) Finds a module that is within the current module (or class).getName()
Deprecated.getName
(ThreadContext context) Generate a fully-qualified class name or a #-style name for anonymous and singleton classes.This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.Deprecated.In an included or prepended module what is the ACTUAL module it represents?Get the "real" module, either the current one or the nearest ancestor that is not a singleton or include wrapper.Deprecated.getSimpleName
(ThreadContext context) Get the "simple" name for the class, which is either the "base" name or the "anonymous" class name.Deprecated.Deprecated.Getter for property superClass.boolean
hasAncestor
(RubyModule type) hasAutoload
(ThreadContext context, String idString, boolean inherit) boolean
hasClassVariable
(String name) boolean
hasConstant
(String name) hash
(ThreadContext context) Will return the hash code of this object.int
hashCode()
This override does not do "checked" dispatch since Object usually has #hash defined.boolean
Behaves similarly togetClassVar(ThreadContext, String)
.boolean
boolean
boolean
include
(IRubyObject[] modules) Deprecated.<T extends RubyModule>
Tinclude
(ThreadContext context, RubyModule module) In Defining this type include a module.include
(ThreadContext context, IRubyObject module) include
(ThreadContext context, IRubyObject[] modules) rb_mod_includeinclude_p
(ThreadContext context, IRubyObject arg) included
(ThreadContext context, IRubyObject other) included_modules
(ThreadContext context) rb_mod_included_modulesvoid
includeModule
(IRubyObject arg) Deprecated.void
includeModule
(ThreadContext context, IRubyObject arg) Include a new module in this module or class.initialize
(Block block) Deprecated.initialize
(ThreadContext context, Block block) rb_mod_initializeinitialize_copy
(ThreadContext context, IRubyObject original) mri: rb_mod_init_copyinstance_method
(IRubyObject symbol) Deprecated.instance_method
(ThreadContext context, IRubyObject symbol) RubyArray
<?> instance_methods
(IRubyObject[] args) Deprecated.instance_methods
(ThreadContext context, IRubyObject[] args) RubyArray
<?> instance_methods19
(IRubyObject[] args) Deprecated.instanceMethods
(IRubyObject[] args, Visibility visibility, boolean obj, boolean not) Deprecated.instanceMethods
(ThreadContext context, IRubyObject[] args, Visibility visibility, boolean obj, boolean not) instanceMethods
(Visibility visibility, boolean includeSuper, boolean obj, boolean not) Deprecated.void
Deprecated.void
invalidateCacheDescendants
(ThreadContext context) protected void
invalidateConstantCache
(String constantName) Deprecated.protected void
invalidateConstantCache
(ThreadContext context, String constantName) protected void
invalidateConstantCaches
(Set<String> constantNames) Deprecated.protected void
Deprecated.boolean
isClass()
Specifically polymorphic method that are meant to be overridden by classes to specify that they are classes in an easy way.boolean
isClassVarDefined
(String name) Is class var defined? Ruby C equivalent = "rb_cvar_defined"boolean
isConstantDefined
(String name) Deprecated.boolean
isConstantDefined
(String name, boolean inherit) Deprecated.boolean
isConstantDefined
(ThreadContext context, String name) boolean
Is this module one that in an included one (e.g.boolean
boolean
isInstance
(IRubyObject object) boolean
isKindOfModule
(RubyModule type) boolean
isMethodBound
(String name, boolean checkVisibility) MRI: rb_method_boundpboolean
isMethodBound
(String name, boolean checkVisibility, boolean checkRespondTo) Deprecated.boolean
isMethodBuiltin
(String methodName) Return true if the given method is defined on this class and is a builtin, i.e.boolean
isModule()
Specifically polymorphic method that are meant to be overridden by modules to specify that they are modules in an easy way.boolean
boolean
protected boolean
isSame
(RubyModule module) protected boolean
isSameOrigin
(RubyModule other) boolean
boolean
static boolean
isValidConstantName
(ByteList bytelist, int start, int end) static boolean
<T extends RubyModule>
TkindOf
(RubyModule.KindOf kindOf) Set the method for determining whether an Object is a kind of the supplied type.static TypePopulator
loadPopulatorFor
(Class<?> type) static void
marshalTo
(RubyModule module, MarshalStream output) Deprecated, for removal: This API element is subject to removal in a future version.static void
marshalTo
(ThreadContext context, RubyOutputStream out, RubyModule module, MarshalDumper output) method_added
(ThreadContext context, IRubyObject nothing) method_defined_p
(ThreadContext context, IRubyObject symbol) method_defined_p
(ThreadContext context, IRubyObject symbol, IRubyObject includeSuper) method_removed
(ThreadContext context, IRubyObject nothing) method_undefined
(ThreadContext context, IRubyObject nothing) protected void
methodAdded
(ThreadContext context, RubySymbol identifier) mix
(ThreadContext context, IRubyObject modArg) mix
(ThreadContext context, IRubyObject modArg, IRubyObject hash0) module_eval
(ThreadContext context, Block block) module_eval
(ThreadContext context, IRubyObject[] args, Block block) module_eval
(ThreadContext context, IRubyObject arg0, Block block) module_eval
(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) module_eval
(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) module_exec
(ThreadContext context, Block block) module_exec
(ThreadContext context, IRubyObject[] args, Block block) module_function
(ThreadContext context, IRubyObject[] args) name()
Deprecated.name
(ThreadContext context) boolean
static RubyArray
nesting
(ThreadContext context, IRubyObject recv, Block block) Return an array of nested modules or classes.static Map
<RubyModule, IncludedModule> protected final MethodHandle
newIncludeClass
(RubyClass superClazz) Deprecated.final IRubyObject
newMethod
(IRubyObject receiver, String methodName, boolean bound, Visibility visibility) Deprecated.final IRubyObject
newMethod
(IRubyObject receiver, String methodName, boolean bound, Visibility visibility, boolean respondToMissing) Deprecated.newMethod
(IRubyObject receiver, String methodName, boolean bound, Visibility visibility, boolean respondToMissing, boolean priv) Deprecated.final IRubyObject
newMethod
(IRubyObject receiver, String methodName, StaticScope refinedScope, boolean bound, Visibility visibility) Deprecated.final IRubyObject
newMethod
(IRubyObject receiver, String methodName, StaticScope scope, boolean bound, Visibility visibility, boolean respondToMissing) Deprecated.newMethod
(IRubyObject receiver, String methodName, StaticScope scope, boolean bound, Visibility visibility, boolean respondToMissing, boolean priv) Deprecated.protected IRubyObject
newMethod
(ThreadContext context, IRubyObject receiver, String methodName, StaticScope scope, boolean bound, Visibility visibility, boolean respondToMissing, boolean priv) static RubyModule
Deprecated.static RubyModule
newModule
(Ruby runtime, String name, RubyModule parent, boolean setParent) Deprecated.static RubyModule
newModule
(Ruby runtime, String name, RubyModule parent, boolean setParent, String file, int line) Deprecated.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.static RubyModule
newModuleBootstrap
(Ruby runtime, String name, RubyModule parent) static Map
<RubyModule, RubyModule> static Map
<RubyModule, RubyModule> newRefinementsMap
(Map<RubyModule, RubyModule> refinements) op_cmp
(IRubyObject obj) Deprecated.op_cmp
(ThreadContext context, IRubyObject obj) rb_mod_cmpop_eqq
(ThreadContext context, IRubyObject obj) rb_mod_eqqop_equal
(ThreadContext context, IRubyObject other) rb_obj_equal Will by default use identity equality to compare objects.op_ge
(IRubyObject obj) Deprecated.op_ge
(ThreadContext context, IRubyObject obj) rb_mod_geop_gt
(IRubyObject obj) Deprecated.op_gt
(ThreadContext context, IRubyObject obj) rb_mod_gtop_le
(IRubyObject arg) Deprecated.op_le
(ThreadContext context, IRubyObject arg) MRI: rb_class_inherited_pop_lt
(IRubyObject obj) Deprecated.op_lt
(ThreadContext context, IRubyObject obj) rb_mod_ltprepend
(ThreadContext context, IRubyObject[] modules) prepend_features
(IRubyObject include) Deprecated.prepend_features
(ThreadContext context, IRubyObject include) rb_mod_prepend_featuresprepended
(ThreadContext context, IRubyObject other) void
prependModule
(RubyModule module) Deprecated.void
prependModule
(IRubyObject arg) Deprecated.void
prependModule
(ThreadContext context, RubyModule module) Prepend a new module to this module or class.private_class_method
(IRubyObject[] args) Deprecated.private_class_method
(ThreadContext context, IRubyObject[] args) private_constant
(ThreadContext context, IRubyObject name) private_constant
(ThreadContext context, IRubyObject[] rubyNames) private_instance_methods
(IRubyObject[] args) Deprecated.private_instance_methods
(ThreadContext context, IRubyObject[] args) rb_class_private_instance_methodsprivate_method_defined
(ThreadContext context, IRubyObject symbol) private_method_defined
(ThreadContext context, IRubyObject symbol, IRubyObject includeSuper) Deprecated.protected_instance_methods
(ThreadContext context, IRubyObject[] args) rb_class_protected_instance_methodsprotected_method_defined
(ThreadContext context, IRubyObject symbol) protected_method_defined
(ThreadContext context, IRubyObject symbol, IRubyObject includeSuper) public_class_method
(IRubyObject[] args) Deprecated.public_class_method
(ThreadContext context, IRubyObject[] args) public_constant
(ThreadContext context, IRubyObject name) public_constant
(ThreadContext context, IRubyObject[] rubyNames) public_instance_method
(IRubyObject symbol) Deprecated.public_instance_method
(ThreadContext context, IRubyObject symbol) RubyArray
<?> public_instance_methods
(IRubyObject[] args) Deprecated.public_instance_methods
(ThreadContext context, IRubyObject[] args) RubyArray
<?> public_instance_methods19
(IRubyObject[] args) Deprecated.public_method_defined
(ThreadContext context, IRubyObject symbol) public_method_defined
(ThreadContext context, IRubyObject symbol, IRubyObject includeSuper) boolean
publicConstDefinedFrom
(String name) Deprecated.boolean
publicConstDefinedFrom
(ThreadContext context, String name) void
putAlias
(String id, DynamicMethod method, String oldName) Deprecated.void
putAlias
(String id, CacheEntry entry, String oldName) Deprecated.void
putAlias
(ThreadContext context, String id, DynamicMethod method, String oldName) Note: Internal API - only public as its used by generated code!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.putMethod
(Ruby runtime, String id, DynamicMethod method) Deprecated.putMethod
(ThreadContext context, String id, DynamicMethod method) Note: Internal API - only public as its used by generated code!rbPrivate
(ThreadContext context, IRubyObject[] args) Deprecated.rbProtected
(ThreadContext context, IRubyObject[] args) Deprecated.rbPublic
(ThreadContext context, IRubyObject[] args) Deprecated.refine
(ThreadContext context, IRubyObject klass, Block block) refined_class
(ThreadContext context) Deprecated.refinements
(ThreadContext context) remove_class_variable
(ThreadContext context, IRubyObject name) rb_mod_remove_cvarremove_class_variable19
(ThreadContext context, IRubyObject name) Deprecated.remove_const
(ThreadContext context, IRubyObject rubyName) remove_method
(ThreadContext context, IRubyObject[] args) final void
removeClassProvider
(ClassProvider provider) removeClassVariable
(String name) Deprecated.removeClassVariable
(ThreadContext context, String name) void
removeMethod
(ThreadContext context, String id) resolveRefinedMethod
(RubyModule overlay, CacheEntry entry, String id, boolean cacheUndef) final IRubyObject
resolveUndefConstant
(String name) Deprecated.boolean
respondsToMethod
(String name, boolean checkVisibility) boolean
respondsToMethod
(String name, boolean checkVisibility, StaticScope scope) retrieveMethod
(String name) Search through this module and supermodules for method definitions.ruby2_keywords
(ThreadContext context, IRubyObject[] args) Deprecated.rubyBaseName
(ThreadContext context) rubyName()
Deprecated.rubyName
(ThreadContext context) Generate a fully-qualified class name or a #-style name for anonymous and singleton classes which is properly encoded.protected RubyModule
Behaves similarly togetClassVar(ThreadContext, String)
.final DynamicMethod
searchMethod
(String name) Search through this module and supermodules for method definitions.protected DynamicMethod
Deprecated.searchWithCache
(String 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.final CacheEntry
searchWithCache
(String id, boolean cacheUndef) Search through this module and supermodules for method definitions.searchWithRefinements
(String name, StaticScope refinedScope) Search for the named method in this class and in superclasses applying refinements from the given scope.set_temporary_name
(ThreadContext context, IRubyObject arg) void
setBaseName
(String name) Deprecated.UsebaseName(String)
instead.void
setCacheProxy
(boolean cacheProxy) Set whether this Java proxy class should try to keep its instances idempotent and alive using the ObjectProxyCache.setClassVar
(String name, IRubyObject value) Deprecated.setClassVar
(ThreadContext context, String name, IRubyObject value) Set the named class variable to the given value, provided freeze allows setting it.setConstant
(String name, IRubyObject value) Deprecated.setConstant
(String name, IRubyObject value, boolean hidden) Deprecated.setConstant
(String name, IRubyObject value, String file, int line) Deprecated.setConstant
(ThreadContext context, String name, IRubyObject value) Set the named constant on this module.setConstant
(ThreadContext context, String name, IRubyObject value, boolean hidden) setConstant
(ThreadContext context, String name, IRubyObject value, String file, int line) setConstantQuiet
(String name, IRubyObject value) Deprecated.setConstantQuiet
(ThreadContext context, String name, IRubyObject value) Set the named constant on this module.final void
setConstantVisibility
(Ruby runtime, String name, boolean hidden) Deprecated.final void
setConstantVisibility
(ThreadContext context, String name, boolean hidden) void
setInternalModuleVariable
(String name, IRubyObject value) Behaves similarly tosetClassVar(ThreadContext, String, IRubyObject)
.void
setJavaProxy
(boolean javaProxy) Set whether this class is associated with (i.e.void
setMethodLocation
(RubyModule module) void
setMethodVisibility
(IRubyObject[] methods, Visibility visibility) Deprecated.void
setMethodVisibility
(ThreadContext context, IRubyObject[] methods, Visibility visibility) set_method_visibilityvoid
setParent
(RubyModule parent) void
setRefinements
(Map<RubyModule, RubyModule> refinements) void
setSuperClass
(RubyClass superClass) Deprecated.UsesuperClass(RubyClass)
instead.singleton_class_p
(ThreadContext context) storeClassVariable
(String name, IRubyObject value) Deprecated.storeClassVariable
(ThreadContext context, String name, IRubyObject value) storeConstant
(String name, IRubyObject value) Deprecated.storeConstant
(String name, IRubyObject value, boolean hidden) Deprecated.storeConstant
(String name, IRubyObject value, boolean hidden, String file, int line) Deprecated.storeConstant
(ThreadContext context, String name, IRubyObject value) storeConstant
(ThreadContext context, String name, IRubyObject value, boolean hidden, String file, int line) Get this module/class super class.<T extends RubyModule>
TsuperClass
(RubyClass superClass) Set this module/class super class.Deprecated.symbolName
(ThreadContext context) Generate a fully-qualified class name or a #-style name as a Symbol.void
syncClassVariables
(RubyModule other) void
syncConstants
(RubyModule other) <T extends RubyModule>
TProvide itself to a lambda then return itself.target
(ThreadContext context) static boolean
testModuleMatch
(ThreadContext context, IRubyObject arg0, int id) to_s()
to_s
(ThreadContext context) rb_mod_to_s<T> T
Convert the object to the specified Java class, if possible.void
undef
(ThreadContext context, String name) rb_undefundef_method
(ThreadContext context, IRubyObject[] args) undefined_instance_method
(ThreadContext context) static String
undefinedMethodMessage
(Ruby runtime, IRubyObject name, IRubyObject modName, boolean isModule) void
undefineMethod
(String name) Deprecated.UseundefMethods(ThreadContext, String...)
instead.<T extends RubyModule>
TundefMethods
(ThreadContext context, String... names) Undefine a method from this type.static RubyModule
unmarshalFrom
(UnmarshalStream input) Deprecated, for removal: This API element is subject to removal in a future version.static RubyModule
unmarshalFrom
(ThreadContext context, RubyInputStream in, MarshalLoader input) void
used_modules
(ThreadContext context) used_refinements
(ThreadContext context) using
(ThreadContext context, IRubyObject refinedModule) static void
usingModule
(ThreadContext context, RubyModule cref, IRubyObject refinedModule) boolean
protected final String
validateClassVariable
(String name) Deprecated.protected String
validateClassVariable
(Ruby runtime, IRubyObject object) Deprecated.protected final String
validateClassVariable
(IRubyObject nameObj, String name) Deprecated.protected String
validateClassVariable
(ThreadContext context, IRubyObject object) protected final String
validateConstant
(String name, IRubyObject errorName) Deprecated.protected final String
validateConstant
(IRubyObject name) Deprecated.protected final String
validateConstant
(ThreadContext context, IRubyObject name) Validates name is a valid constant name and returns its id string.Methods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, dig, dig1, dig2, eqlInternal, equalInternal, finishObjectClass, inspect, puts, specificEval, toRubyString, toString
Methods inherited from class org.jruby.RubyBasicObject
addFinalizer, addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkStringType, cloneSetup, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dup, dupFinalizer, dupSetup, ensureInstanceVariablesSettable, eql, eql_p, eql_p, equal_p, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, finishBasicObjectClass, forEachInstanceVariable, forEachInstanceVariableName, frozen_p, getCurrentContext, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMarshalVariableList, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize_copy, inspect, inspect, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval, instance_exec, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, isBuiltin, isFalse, isFrozen, isImmediate, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, makeMetaClass, makeMetaClassBootstrap, method, method, method, method_missing, methods, methods, nil_p, nonFixnumHashCode, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_match, op_not, op_not_equal, op_not_match, private_methods, protected_methods, public_methods, rbClone, rbClone, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method, singleton_method_added, singleton_method_removed, singleton_method_undefined, singleton_methods, singletonClass, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, to_a, trust, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jruby.runtime.builtin.IRubyObject
checkStringType19, dup, marshalLiveVariables
-
Field Details
-
CACHEPROXY_F
public static final int CACHEPROXY_F -
NEEDSIMPL_F
public static final int NEEDSIMPL_F -
REFINED_MODULE_F
public static final int REFINED_MODULE_F -
IS_OVERLAID_F
public static final int IS_OVERLAID_F -
OMOD_SHARED
public static final int OMOD_SHARED -
INCLUDED_INTO_REFINEMENT
public static final int INCLUDED_INTO_REFINEMENT -
TEMPORARY_NAME
public static final int TEMPORARY_NAME -
BUILTIN_CONSTANT
- See Also:
-
MODULE_ALLOCATOR
-
NormalCacheEntryFactory
-
kindOf
-
id
public final int id -
parent
The class/module within whose namespace this class/module resides. -
baseName
The base name of this class/module, excluding nesting. If null, this is an anonymous class. -
methods
-
cachedMethods
-
generation
protected int generation -
generationObject
-
includingHierarchies
protected volatile org.jruby.RubyClass.RubyClassSet includingHierarchies -
methodLocation
Where are the methods of this module/class located? This only happens as a result of prepend (see PrependedModule) where it moves all methods to a PrependedModule which will be beneath the actual module which was prepended. -
superClass
-
index
Deprecated.use RubyModule#getClassIndex()The index of this class in the ClassIndex. Only non-zero for native JRuby classes that have a corresponding entry in ClassIndex.- See Also:
-
SCOPE_CAPTURING_METHODS
Deprecated. -
classIndex
-
methodInvalidator
-
-
Constructor Details
-
RubyModule
separate path for MetaClass construction -
RubyModule
used by MODULE_ALLOCATOR and RubyClass constructors -
RubyModule
standard path for Module construction
-
-
Method Details
-
finishModuleClass
-
finishCreateModuleClass
-
checkValidBindTargetFrom
public void checkValidBindTargetFrom(ThreadContext context, RubyModule originModule, boolean fromBind) throws RaiseException - Throws:
RaiseException
-
getClassIndex
Get the ClassIndex for this class. Will be NO_CLASS for non-core types. -
autoload
-
autoload_p
-
autoload_p
-
hasAutoload
-
getNativeClassIndex
Description copied from class:RubyObject
This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are. Will generally return a value from org.jruby.runtime.ClassIndex- Specified by:
getNativeClassIndex
in interfaceCoreObjectType
- Overrides:
getNativeClassIndex
in classRubyObject
- Returns:
- the ClassIndex of the native type this object was constructed from
- See Also:
-
isModule
public boolean isModule()Description copied from class:RubyBasicObject
Specifically polymorphic method that are meant to be overridden by modules to specify that they are modules in an easy way.- Specified by:
isModule
in interfaceIRubyObject
- Overrides:
isModule
in classRubyBasicObject
- Returns:
- true if an object is Ruby Module instance (note that it will return false for Ruby Classes).
-
isClass
public boolean isClass()Description copied from class:RubyBasicObject
Specifically polymorphic method that are meant to be overridden by classes to specify that they are classes in an easy way.- Specified by:
isClass
in interfaceIRubyObject
- Overrides:
isClass
in classRubyBasicObject
- Returns:
- true if an object is Ruby Class instance (note that it will return false for Ruby singleton classes).
-
isSingleton
public boolean isSingleton() -
isInstance
-
hasAncestor
-
getConstantMap
-
getConstantMapForWrite
-
getAutoloadMap
AutoloadMap must be accessed after checking ConstantMap. Checking UNDEF value in constantMap works as a guard. For looking up constant, check constantMap first then try to get an Autoload object from autoloadMap. For setting constant, update constantMap first and remove an Autoload object from autoloadMap. -
getAutoloadMapForWrite
-
getIncludingHierarchiesForWrite
protected org.jruby.RubyClass.RubyClassSet getIncludingHierarchiesForWrite() -
addIncludingHierarchy
-
getIdTest
-
newIdTest
-
needsImplementer
public boolean needsImplementer() -
newModule
Deprecated.rb_module_new -
newModule
@Deprecated(since="10.0") public static RubyModule newModule(Ruby runtime, String name, RubyModule parent, boolean setParent, String file, int line) Deprecated. -
newModule
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. -
newModule
@Deprecated(since="10.0") public static RubyModule newModule(Ruby runtime, String name, RubyModule parent, boolean setParent) Deprecated. -
newModuleBootstrap
-
addClassProvider
-
removeClassProvider
-
checkForCyclicPrepend
- Throws:
RaiseException
-
getSuperClass
Getter for property superClass.- Returns:
- Value of property superClass.
-
setSuperClass
Deprecated.UsesuperClass(RubyClass)
instead.- Parameters:
superClass
-
-
getParent
-
setParent
-
getMethodLocation
-
setMethodLocation
-
getMethods
-
getMethodsForWrite
-
putMethod
@Deprecated(since="10.0") public DynamicMethod putMethod(Ruby runtime, String id, DynamicMethod method) Deprecated. -
putMethod
Note: Internal API - only public as its used by generated code!
- Parameters:
context
- the current thread contextid
- identifier string (8859_1). Matching entry in symbol table.method
-- Returns:
- method
-
isIncluded
public boolean isIncluded()Is this module one that in an included one (e.g. anIncludedModuleWrapper
).- See Also:
-
isPrepended
public boolean isPrepended() -
getOrigin
In an included or prepended module what is the ACTUAL module it represents?- Returns:
- the actual module of an included/prepended module.
-
getNonIncludedClass
Deprecated. -
getDelegate
-
getRealModule
Get the "real" module, either the current one or the nearest ancestor that is not a singleton or include wrapper. SeeRubyClass.getRealClass()
.- Returns:
- the nearest non-singleton non-include module in the hierarchy
-
getBaseName
Get the base name of this class, or null if it is an anonymous class.- Returns:
- base name of the class
-
setBaseName
Deprecated.UsebaseName(String)
instead.Set the base name of the class. If null, the class effectively becomes anonymous (though constants elsewhere may reference it).- Parameters:
name
- the new base name of the class
-
getName
Deprecated. -
getName
Generate a fully-qualified class name or a #-style name for anonymous and singleton classes. Ruby C equivalent = "classname"- Returns:
- The generated class name
-
rubyName
Deprecated. -
rubyName
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.
-
symbolName
Deprecated. -
symbolName
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.
-
rubyBaseName
Deprecated. -
rubyBaseName
-
getSimpleName
Deprecated. -
getSimpleName
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
-
set_temporary_name
-
refine
-
using
-
usingModule
-
newRefinementsMap
-
newRefinementsMap
-
newActivatedRefinementsMap
-
used_modules
-
newIncludeClass
Deprecated.Create a wrapper to use for including the specified module into this one. Ruby C equivalent = "include_class_new"- Returns:
- The module wrapper
-
getModule
Deprecated. -
getModule
Finds a module that is within the current module (or class).- Parameters:
name
- to be found in this module (or class)- Returns:
- the module or null if no such module
- Since:
- 9.2
-
getClass
Deprecated. -
getClass
Finds a class that is within the current module/class. Also consider using the various methods inAccess
when they are core types to avoid a hash lookup.- Parameters:
context
- the current thread contextname
- to be found in this module (or class)- Returns:
- the class or null if no such class
-
fastGetClass
Deprecated. -
prependModule
Deprecated. -
prependModule
Prepend a new module to this module or class. MRI: rb_prepend_module- Parameters:
module
- The module to include
-
prependModule
Deprecated. -
includeModule
Deprecated. -
includeModule
Include a new module in this module or class.- Parameters:
arg
- The module to include
-
defineAnnotatedMethod
Deprecated.UsedefineMethods(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.- Parameters:
clazz
-name
-
-
defineAnnotatedConstants
Deprecated.UsedefineConstants(ThreadContext, Class)
instead.- Parameters:
clazz
-
-
defineAnnotatedConstant
Deprecated.UsedefineAnnotatedConstant(ThreadContext, Field)
instead.- Parameters:
field
-- Returns:
- ""
-
defineAnnotatedMethods
Deprecated.UsedefineMethods(ThreadContext, Class[])
instead.- Parameters:
clazz
-
-
loadPopulatorFor
-
defineAnnotatedMethodsIndividually
Deprecated. -
defineAnnotatedMethod
@Deprecated(since="10.0") public final boolean defineAnnotatedMethod(String name, List<JavaMethodDescriptor> methods, MethodFactory methodFactory) Deprecated.UsedefineMethods(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
public final void defineAnnotatedMethod(ThreadContext context, String name, List<JavaMethodDescriptor> methods, 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- Parameters:
context
- the current method contextname
-methods
-methodFactory
-
-
defineAnnotatedMethod
@Deprecated(since="10.0") public final boolean defineAnnotatedMethod(Method method, MethodFactory methodFactory) Deprecated. -
defineAnnotatedMethod
@Deprecated(since="10.0") public final boolean defineAnnotatedMethod(String name, JavaMethodDescriptor desc, MethodFactory methodFactory) Deprecated. -
baseName
Set the base name of the class. If null, the class effectively becomes anonymous (though constants elsewhere may reference it).- Parameters:
name
- the new base name of the class- Returns:
- itself for a composable API.
-
classIndex
Sets the ClassIndex for this type- Parameters:
classIndex
- to be set- Returns:
- itself for composable API
-
defineClassUnder
public <T extends RubyClass> T defineClassUnder(ThreadContext context, String name, RubyClass superClass, ObjectAllocator allocator) Define a Class under this Class/Module.- Parameters:
context
- the current thread contextname
- name of the new classsuperClass
- superclass of this new classallocator
- how to allocate an instance of this class- Returns:
- the new class
-
defineConstants
Define constant for your module/class with the supplied Class which contains @JRubyMethod annotations.- Parameters:
context
-constantSource
- class containing the method annotations- Returns:
- itself for composable API
-
defineConstantsFrom
public <C extends Enum<C> & jnr.constants.Constant,T extends RubyModule> T defineConstantsFrom(ThreadContext context, Class<C> enumClass) Define all constants from the given jnr-constants enum which are defined on the current platform.- Type Parameters:
C
- the enum type, which must implementConstant
.- Parameters:
context
- the current thread contextenumClass
- the enum class of the constants to define- Returns:
- itself for composable API
-
defineModuleUnder
Define a module under this module.- Parameters:
context
-name
-- Returns:
- itself for a composable API
-
defineMethods
Define methods for your module/class with the supplied Class which contains @JRubyMethod annotations.- Parameters:
context
-methodSources
- class containing the method annotations- Returns:
- itself for composable API
-
include
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.- Parameters:
context
-module
- to be included- Returns:
- itself for composable API
-
kindOf
Set the method for determining whether an Object is a kind of the supplied type.- Type Parameters:
T
- class or module types- Parameters:
kindOf
- method to determine kind-of status- Returns:
- itself for composblae API
-
superClass
Get this module/class super class.- Returns:
- the super class
-
superClass
Set this module/class super class.- Type Parameters:
T
- class or module type- Parameters:
superClass
- to be set- Returns:
- itself for composable API
-
tap
Provide itself to a lambda then return itself.- Type Parameters:
T
- A module or class- Parameters:
consumer
- to be given this- Returns:
- this
-
undefMethods
Undefine a method from this type.- Parameters:
context
-names
- the methods to undefine- Returns:
- this type for composable API
-
undefineMethod
Deprecated.UseundefMethods(ThreadContext, String...)
instead. -
undef
rb_undef -
include_p
-
singleton_class_p
-
addMethod
Deprecated. -
addMethod
-
addMethodInternal
Deprecated. -
addMethodInternal
-
removeMethod
-
searchMethod
Search through this module and supermodules for method definitions. Cache superclass definitions in this class.- Parameters:
name
- The name of the method to search for- Returns:
- The method, or UndefinedMethod if not found
-
searchWithCache
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- Parameters:
name
- the method name- Returns:
- the CacheEntry corresponding to the method and this class's serial number
-
searchWithRefinements
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.- Parameters:
name
- the method namerefinedScope
- the scope containing refinements to search- Returns:
- the method or UndefinedMethod
-
searchWithCache
Search through this module and supermodules for method definitions. Cache superclass definitions in this class. MRI: method_entry_get- Parameters:
id
- The name of the method to search forcacheUndef
- Flag for caching UndefinedMethod. This should normally be true.- Returns:
- The method, or UndefinedMethod if not found
-
getCacheToken
Deprecated. -
getGeneration
public final int getGeneration() -
getGenerationObject
-
getCachedMethods
-
becomeSynchronized
public void becomeSynchronized() -
isSynchronized
public boolean isSynchronized() -
addToCache
protected CacheEntry addToCache(String id, DynamicMethod method, RubyModule sourceModule, int token) -
addToCache
-
searchMethodInner
-
searchMethodEntryInner
-
searchMethodLateral
Deprecated.Searches for a method up until the superclass, but include modules. -
resolveRefinedMethod
public CacheEntry resolveRefinedMethod(RubyModule overlay, CacheEntry entry, String id, boolean cacheUndef) -
searchMethodCommon
-
invalidateCacheDescendants
Deprecated. -
invalidateCacheDescendants
-
invalidateCoreClasses
Deprecated. -
getInvalidator
-
updateGeneration
public void updateGeneration() -
invalidateConstantCache
Deprecated. -
invalidateConstantCache
-
invalidateConstantCaches
Deprecated. -
retrieveMethod
Search through this module and supermodules for method definitions. Cache superclass definitions in this class.- Parameters:
name
- The name of the method to search for- Returns:
- The method, or UndefinedMethod if not found
-
findImplementer
Find the given class in this hierarchy, considering modules along the way.- Parameters:
clazz
- the class to find- Returns:
- The method, or UndefinedMethod if not found
-
addModuleFunction
Deprecated. -
defineAlias
Deprecated.- Parameters:
name
-oldName
-
-
putAlias
Deprecated. -
putAlias
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.
- Parameters:
id
-method
-oldName
-
-
putAlias
Deprecated. -
putAlias
Alias the method contained in the given CacheEntry as a new entry in this module.- Parameters:
id
-entry
-oldName
-
-
defineOrGetClassUnder
Deprecated. -
defineOrGetClassUnder
@Deprecated(since="10.0") public RubyClass defineOrGetClassUnder(String name, RubyClass superClazz, String file, int line) Deprecated. -
defineOrGetClassUnder
@Deprecated(since="10.0") public RubyClass defineOrGetClassUnder(String name, RubyClass superClazz, ObjectAllocator allocator) Deprecated. -
defineOrGetClassUnder
@Deprecated(since="10.0") public RubyClass defineOrGetClassUnder(String name, RubyClass superClazz, ObjectAllocator allocator, String file, int line) Deprecated. -
defineClassUnder
public RubyClass defineClassUnder(ThreadContext context, String name, RubyClass superClazz, 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 atdefineClassUnder(ThreadContext, String, RubyClass, ObjectAllocator)
for native extensions.- Parameters:
name
- to be definedsuperClazz
- the super class of this new classallocator
- how to allocate itfile
- location where it was defined fromline
- location where it was defined from- Returns:
- the new class.
-
defineOrGetModuleUnder
Deprecated.this method should be used only by interpreter or compiler -
defineOrGetModuleUnder
@Deprecated(since="10.0") public RubyModule defineOrGetModuleUnder(String name, String file, int line) Deprecated. -
defineOrGetModuleUnder
-
defineClassUnder
@Deprecated(since="10.0") public RubyClass defineClassUnder(String name, RubyClass superClass, ObjectAllocator allocator) Deprecated.- Parameters:
name
-superClass
-allocator
-- Returns:
- ""
-
defineModuleUnder
Deprecated. -
methodAdded
-
setMethodVisibility
@Deprecated(since="10.0") public void setMethodVisibility(IRubyObject[] methods, Visibility visibility) Deprecated. -
setMethodVisibility
public void setMethodVisibility(ThreadContext context, IRubyObject[] methods, Visibility visibility) set_method_visibility -
exportMethod
Deprecated. -
undefinedMethodMessage
public static String undefinedMethodMessage(Ruby runtime, IRubyObject name, IRubyObject modName, boolean isModule) -
isMethodBound
MRI: rb_method_boundp -
respondsToMethod
-
respondsToMethod
-
isMethodBound
@Deprecated public boolean isMethodBound(String name, boolean checkVisibility, boolean checkRespondTo) Deprecated. -
newMethod
@Deprecated(since="10.0") public final IRubyObject newMethod(IRubyObject receiver, String methodName, boolean bound, Visibility visibility) Deprecated. -
newMethod
@Deprecated(since="10.0") public final IRubyObject newMethod(IRubyObject receiver, String methodName, StaticScope refinedScope, boolean bound, Visibility visibility) Deprecated. -
newMethod
@Deprecated(since="10.0") public final IRubyObject newMethod(IRubyObject receiver, String methodName, boolean bound, Visibility visibility, boolean respondToMissing) Deprecated. -
newMethod
@Deprecated(since="10.0") public final IRubyObject newMethod(IRubyObject receiver, String methodName, StaticScope scope, boolean bound, Visibility visibility, boolean respondToMissing) Deprecated. -
newMethod
@Deprecated(since="10.0") public IRubyObject newMethod(IRubyObject receiver, String methodName, boolean bound, Visibility visibility, boolean respondToMissing, boolean priv) Deprecated. -
newMethod
@Deprecated(since="10.0") public IRubyObject newMethod(IRubyObject receiver, String methodName, StaticScope scope, boolean bound, Visibility visibility, boolean respondToMissing, boolean priv) Deprecated. -
newMethod
protected IRubyObject newMethod(ThreadContext context, IRubyObject receiver, String methodName, StaticScope scope, boolean bound, Visibility visibility, boolean respondToMissing, boolean priv) -
define_method
-
defineMethodFromBlock
public IRubyObject defineMethodFromBlock(ThreadContext context, IRubyObject arg0, Block block, Visibility visibility) -
define_method
public IRubyObject define_method(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) -
defineMethodFromCallable
public IRubyObject defineMethodFromCallable(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Visibility visibility) -
define_method
@Deprecated public IRubyObject define_method(ThreadContext context, IRubyObject[] args, Block block) Deprecated. -
name
Deprecated. -
name
-
cloneMethods
Deprecated. -
cloneMethods
-
initialize_copy
mri: rb_mod_init_copy- Overrides:
initialize_copy
in classRubyBasicObject
- Parameters:
context
- the thread contextoriginal
- the original- Returns:
- a copy unless the same thing
-
syncConstants
-
syncClassVariables
-
included_modules
rb_mod_included_modules -
hasPrepends
public boolean hasPrepends() -
ancestors
rb_mod_ancestors -
ancestors
Deprecated. -
getAncestorList
-
hasModuleInPrepends
-
hasModuleInHierarchy
-
hashCode
public int hashCode()Description copied from class:RubyObject
This override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCode
in classRubyObject
- Returns:
- the hash code
- See Also:
-
hash
Description copied from class:RubyBasicObject
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.- Overrides:
hash
in classRubyBasicObject
- Parameters:
context
- the current thread context- Returns:
- the hash value
-
to_s
- Overrides:
to_s
in classRubyBasicObject
- Returns:
- ""
-
to_s
rb_mod_to_s- Overrides:
to_s
in classRubyBasicObject
-
op_eqq
rb_mod_eqq- Specified by:
op_eqq
in interfaceIRubyObject
- Overrides:
op_eqq
in classRubyObject
-
equals
We override equals here to provide a faster path, since equality for modules is pretty cut and dried.- Overrides:
equals
in classRubyObject
- Parameters:
other
- The object to check for equality- Returns:
- true if reference equality, false otherwise
- See Also:
-
op_equal
Description copied from class:RubyBasicObject
rb_obj_equal Will by default use identity equality to compare objects. This follows the Ruby semantics. The name of this method doesn't follow the convention because hierarchy problems- Specified by:
op_equal
in interfaceIRubyObject
- Overrides:
op_equal
in classRubyBasicObject
-
freeze
rb_mod_freeze- Overrides:
freeze
in classRubyBasicObject
-
op_le
Deprecated. -
op_le
MRI: rb_class_inherited_p -
searchAncestor
-
op_lt
Deprecated. -
op_lt
rb_mod_lt -
op_ge
Deprecated. -
op_ge
rb_mod_ge -
op_gt
Deprecated. -
op_gt
rb_mod_gt -
op_cmp
rb_mod_cmp- Overrides:
op_cmp
in classRubyBasicObject
-
op_cmp
Deprecated. -
isKindOfModule
-
isSame
-
isSameOrigin
-
initialize
rb_mod_initialize -
addReadWriteAttribute
-
addReadAttribute
-
addWriteAttribute
-
ruby2_keywords
-
attr
rb_mod_attr -
attr_reader
Deprecated. -
attr_reader
rb_mod_attr_reader -
attr_writer
rb_mod_attr_writer -
attr_accessor
Deprecated. -
attr_accessor
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. -
instanceMethods
@Deprecated(since="10.0") public RubyArray instanceMethods(IRubyObject[] args, Visibility visibility, boolean obj, boolean not) Deprecated. -
instanceMethods
public RubyArray instanceMethods(ThreadContext context, IRubyObject[] args, Visibility visibility, boolean obj, boolean not) -
instanceMethods
@Deprecated(since="10.0") public RubyArray instanceMethods(Visibility visibility, boolean includeSuper, boolean obj, boolean not) Deprecated. -
addMethodSymbols
@Deprecated(since="10.0") protected void addMethodSymbols(Ruby runtime, Set<String> seen, RubyArray ary, boolean not, Visibility visibility) Deprecated. -
addMethodSymbols
protected void addMethodSymbols(ThreadContext context, Set<String> seen, RubyArray ary, boolean not, Visibility visibility) -
instance_methods19
Deprecated. -
instance_methods
Deprecated. -
instance_methods
-
public_instance_methods19
Deprecated. -
public_instance_methods
Deprecated. -
public_instance_methods
-
instance_method
-
instance_method
Deprecated. -
public_instance_method
Deprecated. -
public_instance_method
-
protected_instance_methods
Deprecated. -
protected_instance_methods
rb_class_protected_instance_methods -
private_instance_methods
Deprecated. -
private_instance_methods
rb_class_private_instance_methods -
undefined_instance_method
-
prepend_features
Deprecated. -
prepend_features
rb_mod_prepend_features -
append_features
Deprecated. -
append_features
rb_mod_append_features -
extend_object
Deprecated. -
extend_object
rb_mod_extend_object -
include
Deprecated. -
include
rb_mod_include -
include
-
included
-
extended
-
mix
-
mix
-
_public
rb_mod_public -
rbPublic
Deprecated. -
_protected
rb_mod_protected -
rbProtected
Deprecated. -
_private
rb_mod_private -
rbPrivate
Deprecated. -
_module_function
rb_mod_modfunc -
module_function
-
const_added
-
method_added
-
method_removed
-
method_undefined
-
method_defined_p
-
method_defined_p
public RubyBoolean method_defined_p(ThreadContext context, IRubyObject symbol, IRubyObject includeSuper) -
public_method_defined
-
public_method_defined
public IRubyObject public_method_defined(ThreadContext context, IRubyObject symbol, IRubyObject includeSuper) -
protected_method_defined
-
protected_method_defined
public IRubyObject protected_method_defined(ThreadContext context, IRubyObject symbol, IRubyObject includeSuper) -
private_method_defined
-
private_method_defined
public IRubyObject private_method_defined(ThreadContext context, IRubyObject symbol, IRubyObject includeSuper) -
public_class_method
Deprecated. -
public_class_method
-
private_class_method
Deprecated. -
private_class_method
-
aliasMethod
Add an alias under the name newId pointing at the method under the name oldId.- Parameters:
context
- the current contextnewId
- the new name for the aliasoldId
- the current name of the method- Returns:
- the new name
-
alias_method
Old version ofaliasMethod(ThreadContext, IRubyObject, IRubyObject)
that returns this module. The Ruby alias_method method was updated in 3.0 to return the new name.- Parameters:
context
- the current contextnewId
- the new name for the aliasoldId
- the current name of the method- Returns:
- this module
-
undef_method
-
module_eval
-
module_eval
-
module_eval
public IRubyObject module_eval(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) -
module_eval
public IRubyObject module_eval(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) -
module_eval
-
module_exec
-
module_exec
-
remove_method
-
marshalTo
@Deprecated(since="10.0", forRemoval=true) public static void marshalTo(RubyModule module, MarshalStream output) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
-
marshalTo
public static void marshalTo(ThreadContext context, RubyOutputStream out, RubyModule module, MarshalDumper output) -
unmarshalFrom
@Deprecated(since="10.0", forRemoval=true) public static RubyModule unmarshalFrom(UnmarshalStream input) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
-
unmarshalFrom
public static RubyModule unmarshalFrom(ThreadContext context, RubyInputStream in, MarshalLoader input) -
nesting
Return an array of nested modules or classes. -
class_variable_defined_p
-
class_variable_get19
Deprecated. -
class_variable_get
Deprecated. -
class_variable_get
rb_mod_cvar_get -
class_variable_set
@Deprecated(since="10.0") public IRubyObject class_variable_set(IRubyObject name, IRubyObject value) Deprecated. -
class_variable_set
rb_mod_cvar_set -
class_variable_set19
Deprecated. -
remove_class_variable
rb_mod_remove_cvar -
remove_class_variable19
Deprecated. -
class_variables
-
class_variables
-
const_defined_p
rb_mod_const_defined -
const_defined_p
-
const_get
-
const_get
-
isValidConstantPath
-
isValidConstantName
-
const_source_location
-
const_set
Deprecated. -
const_set
rb_mod_const_set -
remove_const
-
const_missing
Base implementation of Module#const_missing, throws NameError for specific missing constant.- Parameters:
rubyName
- The constant name which was found to be missing- Returns:
- Nothing! Absolutely nothing! (though subclasses might choose to return something)
-
constants
-
constants
-
constantsCommon
public Collection<String> constantsCommon(Ruby runtime, boolean replaceModule, boolean allConstants) rb_mod_constants -
constantsCommon
public Collection<String> constantsCommon(Ruby runtime, boolean replaceModule, boolean allConstants, boolean includePrivate) -
deprecateConstant
Deprecated. -
deprecateConstant
Mark the named constant as deprecated.- Parameters:
context
- the current thread contextname
- the name of the constant
-
deprecate_constant
-
deprecate_constant
-
private_constant
-
private_constant
-
public_constant
-
public_constant
-
prepend
-
prepended
-
setConstantVisibility
@Deprecated(since="10.0") public final void setConstantVisibility(Ruby runtime, String name, boolean hidden) Deprecated. -
setConstantVisibility
-
refinements
-
refined_class
Deprecated. -
target
-
used_refinements
-
setClassVar
Deprecated. -
setClassVar
Set the named class variable to the given value, provided freeze allows setting it. Ruby C equivalent = "rb_cvar_set"- Parameters:
name
- The variable name to setvalue
- The value to set it to
-
fastSetClassVar
Deprecated. -
getClassVar
Deprecated. -
getClassVar
Retrieve the specified class variable, searching through this module, included modules, and supermodules. Ruby C equivalent = "rb_cvar_get"- Parameters:
name
- The name of the variable to retrieve- Returns:
- The variable's value, or throws NameError if not found
-
getClassVar
Deprecated. -
getClassVar
-
getClassVarQuiet
Deprecated. -
fastGetClassVar
Deprecated. -
isClassVarDefined
Is class var defined? Ruby C equivalent = "rb_cvar_defined"- Parameters:
name
- The class var to determine "is defined?"- Returns:
- true if true, false if false
-
fastIsClassVarDefined
Deprecated. -
removeClassVariable
Deprecated. -
removeClassVariable
-
getConstantAtSpecial
Deprecated. -
getConstantAtSpecial
This version searches superclasses if we're starting with Object. This corresponds to logic in rb_const_defined_0 that recurses for Object only.- Parameters:
name
- the constant name to find- Returns:
- the constant, or null if it was not found
-
getConstantAt
Deprecated. -
getConstantAt
-
getConstantAt
Deprecated. -
getConstantAt
-
fastGetConstantAt
Deprecated. -
getConstant
Deprecated. -
getConstant
Retrieve the named constant, invoking 'const_missing' should that be appropriate.- Parameters:
name
- The constant to retrieve- Returns:
- The value for the constant, or null if not found
-
getConstant
Deprecated. -
getConstant
-
getConstantSourceLocation
@Deprecated(since="10.0") public RubyModule.SourceLocation getConstantSourceLocation(String name, boolean inherit, boolean includeObject) Deprecated. -
getConstantSourceLocation
public RubyModule.SourceLocation getConstantSourceLocation(ThreadContext context, String name, boolean inherit, boolean includeObject) -
getConstant
@Deprecated(since="10.0") public IRubyObject getConstant(String name, boolean inherit, boolean includeObject) Deprecated. -
getConstant
public IRubyObject getConstant(ThreadContext context, String name, boolean inherit, boolean includeObject) -
fastGetConstant
Deprecated. -
fastGetConstant
Deprecated. -
getConstantNoConstMissing
Deprecated. -
getConstantNoConstMissing
-
getConstantNoConstMissing
@Deprecated(since="10.0") public IRubyObject getConstantNoConstMissing(String name, boolean inherit) Deprecated. -
getConstantNoConstMissing
-
getConstantNoConstMissing
@Deprecated(since="10.0") public IRubyObject getConstantNoConstMissing(String name, boolean inherit, boolean includeObject) Deprecated. -
getConstantNoConstMissing
public IRubyObject getConstantNoConstMissing(ThreadContext context, String name, boolean inherit, boolean includeObject) -
getConstantNoConstMissingSkipAutoload
@Deprecated(since="10.0") public final IRubyObject getConstantNoConstMissingSkipAutoload(String name) Deprecated. -
getConstantNoConstMissingSkipAutoload
-
getConstantNoConstMissingSKipAutoload
Deprecated. -
getConstantFrom
Deprecated. -
getConstantFrom
-
getConstantWithAutoload
@Deprecated(since="10.0") public IRubyObject getConstantWithAutoload(String name, IRubyObject failedAutoloadValue, boolean includePrivate) Deprecated. -
getConstantWithAutoload
public IRubyObject getConstantWithAutoload(ThreadContext context, String name, IRubyObject failedAutoloadValue, boolean includePrivate) Search just this class for a constant value, or trigger autoloading.- Parameters:
name
-- Returns:
-
fastGetConstantFrom
Deprecated. -
getConstantFromNoConstMissing
Deprecated. -
getConstantFromNoConstMissing
-
getConstantFromNoConstMissing
@Deprecated(since="10.0") public IRubyObject getConstantFromNoConstMissing(String name, boolean includePrivate) Deprecated. -
getConstantFromNoConstMissing
public IRubyObject getConstantFromNoConstMissing(ThreadContext context, String name, boolean includePrivate) -
fastGetConstantFromNoConstMissing
Deprecated. -
getConstantFromConstMissing
Deprecated. -
getConstantFromConstMissing
-
fastGetConstantFromConstMissing
Deprecated. -
resolveUndefConstant
Deprecated. -
setConstantQuiet
Deprecated. -
setConstantQuiet
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.- Parameters:
name
- The name to assignvalue
- The value to assign to it; if an unnamed Module, also set its basename to name- Returns:
- The result of setting the variable.
-
setConstant
Deprecated. -
setConstant
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.- Parameters:
name
- The name to assignvalue
- The value to assign to it; if an unnamed Module, also set its basename to name- Returns:
- The result of setting the variable.
-
setConstant
@Deprecated(since="10.0") public IRubyObject setConstant(String name, IRubyObject value, String file, int line) Deprecated. -
setConstant
public IRubyObject setConstant(ThreadContext context, String name, IRubyObject value, String file, int line) -
setConstant
@Deprecated(since="10.0") public IRubyObject setConstant(String name, IRubyObject value, boolean hidden) Deprecated. -
setConstant
public IRubyObject setConstant(ThreadContext context, String name, IRubyObject value, boolean hidden) -
fastSetConstant
@Deprecated(since="9.4-") public IRubyObject fastSetConstant(String internedName, IRubyObject value) Deprecated. -
defineAlias
Define an alias on this module/class.- Parameters:
context
- the current thread contextname
- the new alias nameoldName
- the existing method name- Returns:
- itself for composable API
-
defineConstant
public <T extends RubyModule> T defineConstant(ThreadContext context, String name, IRubyObject value) Define a constant when you are defining your Ruby class/module.- Parameters:
context
- the current thread contextname
- the name of the constantvalue
- the value for the constant- Returns:
- itself for a composable API
-
defineConstant
public <T extends RubyModule> T defineConstant(ThreadContext context, String name, IRubyObject value, boolean hidden) Define a constant when you are defining your Ruby class/module.- Parameters:
context
- the current thread contextname
- the name of the constantvalue
- the value for the constanthidden
- should this be a hidden constant- Returns:
- itself for a composable API
-
defineConstant
Deprecated.rb_define_const -
isConstantDefined
Deprecated. -
constDefined
Deprecated. -
constDefined
-
constDefinedAt
Deprecated. -
constDefinedAt
-
constDefinedFrom
Deprecated. -
constDefinedFrom
-
publicConstDefinedFrom
Deprecated. -
publicConstDefinedFrom
-
autoloadingValue
Deprecated. -
autoloadingValue
-
isConstantDefined
Deprecated. -
isConstantDefined
-
testModuleMatch
-
hasInternalModuleVariable
Behaves similarly togetClassVar(ThreadContext, String)
. Searches this class/module and its ancestors for the specified internal variable.- Parameters:
name
- the internal variable name- Returns:
- the value of the specified internal variable if found, else null
- See Also:
-
searchInternalModuleVariable
Behaves similarly togetClassVar(ThreadContext, String)
. Searches this class/module and its ancestors for the specified internal variable.- Parameters:
name
- the internal variable name- Returns:
- the value of the specified internal variable if found, else null
- See Also:
-
setInternalModuleVariable
Behaves similarly tosetClassVar(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.- Parameters:
name
- the internal variable namevalue
- the internal variable value- See Also:
-
getClassVariables
-
getClassVariablesForRead
-
hasClassVariable
-
fastHasClassVariable
Deprecated. -
fetchClassVariable
-
fastFetchClassVariable
Deprecated. -
storeClassVariable
Deprecated. -
storeClassVariable
-
fastStoreClassVariable
Deprecated. -
deleteClassVariable
Deprecated. -
getClassVariableNameList
-
validateClassVariable
Deprecated. -
validateClassVariable
@Deprecated(since="10.0") protected final String validateClassVariable(IRubyObject nameObj, String name) Deprecated. -
validateClassVariable
Deprecated. -
validateClassVariable
-
ensureClassVariablesSettable
Deprecated. -
hasConstant
-
fastHasConstant
Deprecated. -
fetchConstant
Deprecated. -
fetchConstant
-
fetchConstant
Deprecated. -
fetchConstant
-
fetchConstantEntry
@Deprecated(since="10.0") public RubyModule.ConstantEntry fetchConstantEntry(String name, boolean includePrivate) Deprecated. -
fetchConstantEntry
public RubyModule.ConstantEntry fetchConstantEntry(ThreadContext context, String name, boolean includePrivate) The equivalent for fetchConstant but is useful for extra state like whether the constant is private or not.- Parameters:
name
- of the constant.includePrivate
- include private/hidden constants- Returns:
- the entry for the constant.
-
fastFetchConstant
Deprecated. -
storeConstant
Deprecated. -
storeConstant
-
storeConstant
@Deprecated(since="10.0") public IRubyObject storeConstant(String name, IRubyObject value, boolean hidden, String file, int line) Deprecated. -
storeConstant
public IRubyObject storeConstant(ThreadContext context, String name, IRubyObject value, boolean hidden, String file, int line) -
storeConstant
@Deprecated(since="10.0") public IRubyObject storeConstant(String name, IRubyObject value, boolean hidden) Deprecated. -
fastStoreConstant
Deprecated. -
deleteConstant
Deprecated. -
deleteConstant
-
getStoredConstantList
Deprecated. -
getStoredConstantNameList
Deprecated. -
getConstantNames
- Returns:
- a list of constant names that exists at time this was called
-
getConstantNames
-
validateConstant
Deprecated. -
validateConstant
Validates name is a valid constant name and returns its id string.- Parameters:
name
- object to verify as a valid constant.- Returns:
- the id for this valid constant name.
-
validateConstant
@Deprecated(since="10.0") protected final String validateConstant(String name, IRubyObject errorName) Deprecated. -
ensureConstantsSettable
Deprecated. -
checkFrozen
public final void checkFrozen()Description copied from class:RubyBasicObject
The actual method that checks frozen with the default frozen message from MRI. If possible, call this instead ofRubyBasicObject.testFrozen(java.lang.String)
.- Overrides:
checkFrozen
in classRubyBasicObject
-
constantTableContains
-
constantTableFetch
-
constantEntryFetch
-
constantTableStore
-
constantTableStore
-
defineConstantBootstrap
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.- Parameters:
name
- of the constantvalue
- of the constant
-
constantTableStore
protected IRubyObject constantTableStore(String name, IRubyObject value, boolean hidden, boolean deprecated, String file, int line) -
constantTableStore
protected IRubyObject constantTableStore(String name, IRubyObject value, boolean hidden, boolean deprecated) -
constantTableRemove
-
defineAutoload
Deprecated. -
defineAutoload
Define an autoload. ConstantMap holds UNDEF for the name as an autoload marker. -
finishAutoload
Deprecated. -
finishAutoload
Extract an Object which is defined by autoload thread from autoloadMap and define it as a constant. -
getAutoloadConstant
Deprecated. -
getAutoloadConstant
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. -
getAutoloadConstant
@Deprecated(since="10.0") protected IRubyObject getAutoloadConstant(String name, boolean loadConstant) Deprecated. -
getAutoloadConstant
-
getAutoloadFile
-
initialize
Deprecated. -
setJavaProxy
public void setJavaProxy(boolean javaProxy) Set whether this class is associated with (i.e. a proxy for) a normal Java class or interface. -
getJavaProxy
public boolean getJavaProxy()Get whether this class is associated with (i.e. a proxy for) a normal Java class or interface. -
getCacheProxy
public boolean getCacheProxy()Get whether this Java proxy class should try to keep its instances idempotent and alive using the ObjectProxyCache. -
setCacheProxy
public void setCacheProxy(boolean cacheProxy) Set whether this Java proxy class should try to keep its instances idempotent and alive using the ObjectProxyCache. -
toJava
Description copied from interface:IRubyObject
Convert the object to the specified Java class, if possible.- Specified by:
toJava
in interfaceIRubyObject
- Overrides:
toJava
in classRubyBasicObject
- Type Parameters:
T
- type- Parameters:
target
- The target type to which the object should be converted.- Returns:
- java type
- See Also:
-
discoverInstanceVariables
-
isRefinement
public boolean isRefinement() -
usingTemporaryName
public boolean usingTemporaryName() -
isIncludedIntoRefinement
public boolean isIncludedIntoRefinement() -
isMethodBuiltin
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.- Parameters:
methodName
-- Returns:
-
getRefinements
-
getRefinementsForWrite
-
setRefinements
-
finishRefinementClass
-
fastIsConstantDefined
Deprecated. -
defineAliases
Deprecated. -
const_get
Deprecated. -
const_get
Deprecated. -
const_get_1_9
Deprecated. -
const_get_2_0
Deprecated.
-