public class RubyModule extends RubyObject
Modifier and Type | Class and Description |
---|---|
static interface |
RubyModule.AutoloadMethod |
protected static class |
RubyModule.CacheEntryFactory |
static class |
RubyModule.ConstantEntry
Represents a constant value, possibly hidden (private).
|
static class |
RubyModule.JavaClassKindOf |
static class |
RubyModule.KindOf |
static class |
RubyModule.MethodClumper |
static class |
RubyModule.ModuleKernelMethods |
protected static class |
RubyModule.ProfilingCacheEntryFactory |
static class |
RubyModule.RespondToMissingMethod |
protected static class |
RubyModule.SynchronizedCacheEntryFactory |
protected static class |
RubyModule.WrapperCacheEntryFactory
A wrapper CacheEntryFactory, for delegating cache entry creation along a chain.
|
RubyObject.Data
RubyBasicObject.Finalizer
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
baseName
The base name of this class/module, excluding nesting.
|
protected java.util.Map<java.lang.String,CacheEntry> |
cachedMethods |
static int |
CACHEPROXY_F |
protected ClassIndex |
classIndex |
protected int |
generation |
protected java.lang.Integer |
generationObject |
int |
id |
protected java.util.Set<RubyClass> |
includingHierarchies |
int |
index
Deprecated.
use RubyModule#getClassIndex()
|
static int |
IS_OVERLAID_F |
RubyModule.KindOf |
kindOf |
protected Invalidator |
methodInvalidator |
protected RubyModule |
methodLocation |
protected java.util.Map<java.lang.String,DynamicMethod> |
methods |
static ObjectAllocator |
MODULE_ALLOCATOR |
static int |
NEEDSIMPL_F |
protected static RubyModule.CacheEntryFactory |
NormalCacheEntryFactory |
static int |
OMOD_SHARED |
RubyModule |
parent
The class/module within whose namespace this class/module resides.
|
static int |
REFINED_MODULE_F |
static java.util.Set<java.lang.String> |
SCOPE_CAPTURING_METHODS
Deprecated.
|
protected RubyClass |
superClass |
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR
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, UNTRUST_F, 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
NULL_ARRAY
Modifier | Constructor and Description |
---|---|
protected |
RubyModule(Ruby runtime)
standard path for Module construction
|
protected |
RubyModule(Ruby runtime,
RubyClass metaClass)
used by MODULE_ALLOCATOR and RubyClass constructors
|
protected |
RubyModule(Ruby runtime,
RubyClass metaClass,
boolean objectSpace)
separate path for MetaClass construction
|
Modifier and Type | Method and Description |
---|---|
void |
addClassProvider(ClassProvider provider) |
void |
addIncludingHierarchy(IncludedModule hierarchy) |
void |
addMethod(java.lang.String id,
DynamicMethod method) |
void |
addMethodAtBootTimeOnly(java.lang.String id,
DynamicMethod method)
Deprecated.
No longer used, internal API!
|
void |
addMethodInternal(java.lang.String name,
DynamicMethod method) |
protected void |
addMethodSymbols(Ruby runtime,
java.util.Set<java.lang.String> seen,
RubyArray ary,
boolean not,
Visibility visibility) |
void |
addModuleFunction(java.lang.String name,
DynamicMethod method) |
void |
addReadAttribute(ThreadContext context,
java.lang.String name) |
void |
addReadWriteAttribute(ThreadContext context,
java.lang.String name) |
void |
addWriteAttribute(ThreadContext context,
java.lang.String name) |
RubyModule |
alias_method(ThreadContext context,
IRubyObject newId,
IRubyObject oldId) |
RubyArray |
ancestors()
Deprecated.
|
RubyArray |
ancestors(ThreadContext context)
rb_mod_ancestors
|
RubyModule |
append_features(IRubyObject include)
rb_mod_append_features
|
IRubyObject |
attr_accessor(IRubyObject[] args)
Deprecated.
|
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.
|
IRubyObject |
attr_reader(IRubyObject[] args)
Deprecated.
|
IRubyObject |
attr_reader(ThreadContext context,
IRubyObject[] args)
rb_mod_attr_reader
|
IRubyObject |
attr_writer(ThreadContext context,
IRubyObject[] args)
rb_mod_attr_writer
|
IRubyObject |
attr(ThreadContext context,
IRubyObject[] args)
rb_mod_attr
|
IRubyObject |
attr19(ThreadContext context,
IRubyObject[] args)
Deprecated.
|
void |
becomeSynchronized() |
protected void |
checkForCyclicPrepend(RubyModule m) |
void |
checkFrozen()
The actual method that checks frozen with the default frozen message from MRI.
|
void |
checkValidBindTargetFrom(ThreadContext context,
RubyModule originModule) |
IRubyObject |
class_variable_defined_p(ThreadContext context,
IRubyObject var) |
IRubyObject |
class_variable_get(IRubyObject name)
rb_mod_cvar_get
|
IRubyObject |
class_variable_get19(IRubyObject name) |
IRubyObject |
class_variable_set(IRubyObject name,
IRubyObject value)
rb_mod_cvar_set
|
IRubyObject |
class_variable_set19(IRubyObject name,
IRubyObject value) |
RubyArray |
class_variables(ThreadContext context) |
RubyArray |
class_variables(ThreadContext context,
IRubyObject inherit) |
RubyArray |
class_variables19(ThreadContext context)
Deprecated.
|
protected IRubyObject |
cloneMethods(RubyModule clone) |
RubyBoolean |
const_defined_p(ThreadContext context,
IRubyObject symbol)
rb_mod_const_defined
|
RubyBoolean |
const_defined_p19(ThreadContext context,
IRubyObject[] args) |
IRubyObject |
const_get_1_9(ThreadContext context,
IRubyObject[] args) |
IRubyObject |
const_get_2_0(ThreadContext context,
IRubyObject[] args) |
IRubyObject |
const_get(IRubyObject symbol)
rb_mod_const_get
|
IRubyObject |
const_missing(ThreadContext context,
IRubyObject rubyName,
Block block)
Base implementation of Module#const_missing, throws NameError for specific missing constant.
|
IRubyObject |
const_set(IRubyObject name,
IRubyObject value)
rb_mod_const_set
|
protected RubyModule.ConstantEntry |
constantEntryFetch(java.lang.String name) |
RubyArray |
constants(ThreadContext context) |
RubyArray |
constants(ThreadContext context,
IRubyObject allConstants) |
RubyArray |
constants19(ThreadContext context)
Deprecated.
|
RubyArray |
constants19(ThreadContext context,
IRubyObject allConstants)
Deprecated.
|
java.util.Collection<java.lang.String> |
constantsCommon(Ruby runtime,
boolean replaceModule,
boolean allConstants)
rb_mod_constants
|
java.util.Collection<java.lang.String> |
constantsCommon(Ruby runtime,
boolean replaceModule,
boolean allConstants,
boolean includePrivate) |
RubyArray |
constantsCommon19(ThreadContext context,
boolean replaceModule,
boolean allConstants)
Deprecated.
|
protected boolean |
constantTableContains(java.lang.String name) |
protected IRubyObject |
constantTableFetch(java.lang.String name) |
protected IRubyObject |
constantTableRemove(java.lang.String name) |
protected IRubyObject |
constantTableStore(java.lang.String name,
IRubyObject value) |
protected IRubyObject |
constantTableStore(java.lang.String name,
IRubyObject value,
boolean hidden) |
protected IRubyObject |
constantTableStore(java.lang.String name,
IRubyObject value,
boolean hidden,
boolean deprecated) |
static RubyClass |
createModuleClass(Ruby runtime,
RubyClass moduleClass) |
IRubyObject |
define_method(ThreadContext context,
IRubyObject[] args,
Block block)
Deprecated.
|
IRubyObject |
define_method(ThreadContext context,
IRubyObject arg0,
Block block) |
IRubyObject |
define_method(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
Block block) |
void |
defineAlias(java.lang.String name,
java.lang.String oldName)
rb_alias
|
void |
defineAliases(java.util.List<java.lang.String> aliases,
java.lang.String oldId) |
boolean |
defineAnnotatedConstant(java.lang.reflect.Field field) |
void |
defineAnnotatedConstants(java.lang.Class clazz) |
void |
defineAnnotatedMethod(java.lang.Class clazz,
java.lang.String name) |
boolean |
defineAnnotatedMethod(java.lang.reflect.Method method,
MethodFactory methodFactory) |
boolean |
defineAnnotatedMethod(java.lang.String name,
JavaMethodDescriptor desc,
MethodFactory methodFactory) |
boolean |
defineAnnotatedMethod(java.lang.String name,
java.util.List<JavaMethodDescriptor> methods,
MethodFactory methodFactory) |
void |
defineAnnotatedMethods(java.lang.Class clazz) |
void |
defineAnnotatedMethodsIndividually(java.lang.Class clazz) |
protected void |
defineAutoload(java.lang.String name,
RubyModule.AutoloadMethod loadMethod)
Define an autoload.
|
RubyClass |
defineClassUnder(java.lang.String name,
RubyClass superClass,
ObjectAllocator allocator)
rb_define_class_under
this method should be used only as an API to define/open nested classes
|
void |
defineConstant(java.lang.String name,
IRubyObject value)
rb_define_const
|
IRubyObject |
defineMethodFromBlock(ThreadContext context,
IRubyObject arg0,
Block block,
Visibility visibility) |
IRubyObject |
defineMethodFromCallable(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
Visibility visibility) |
RubyModule |
defineModuleUnder(java.lang.String name)
rb_define_module_under
this method should be used only as an API to define/open nested module
|
RubyClass |
defineOrGetClassUnder(java.lang.String name,
RubyClass superClazz)
this method should be used only by interpreter or compiler
|
RubyClass |
defineOrGetClassUnder(java.lang.String name,
RubyClass superClazz,
ObjectAllocator allocator) |
RubyModule |
defineOrGetModuleUnder(java.lang.String name)
this method should be used only by interpreter or compiler
|
IRubyObject |
deleteClassVariable(java.lang.String name) |
IRubyObject |
deleteConstant(java.lang.String name) |
IRubyObject |
deprecate_constant(ThreadContext context,
IRubyObject name) |
IRubyObject |
deprecate_constant(ThreadContext context,
IRubyObject[] names) |
void |
deprecateConstant(Ruby runtime,
java.lang.String name) |
java.util.Set<java.lang.String> |
discoverInstanceVariables() |
protected void |
ensureClassVariablesSettable() |
protected void |
ensureConstantsSettable() |
boolean |
equals(java.lang.Object other)
We override equals here to provide a faster path, since equality for modules
is pretty cut and dried.
|
void |
exportMethod(java.lang.String name,
Visibility visibility)
rb_export_method
|
IRubyObject |
extend_object(IRubyObject obj)
rb_mod_extend_object
|
IRubyObject |
extended(ThreadContext context,
IRubyObject other,
Block block) |
IRubyObject |
fastFetchClassVariable(java.lang.String internedName)
Deprecated.
|
IRubyObject |
fastFetchConstant(java.lang.String internedName)
Deprecated.
|
RubyClass |
fastGetClass(java.lang.String internedName)
Deprecated.
|
IRubyObject |
fastGetClassVar(java.lang.String internedName)
Deprecated.
|
IRubyObject |
fastGetConstant(java.lang.String internedName)
Deprecated.
|
IRubyObject |
fastGetConstant(java.lang.String internedName,
boolean inherit)
Deprecated.
|
IRubyObject |
fastGetConstantAt(java.lang.String internedName)
Deprecated.
|
IRubyObject |
fastGetConstantFrom(java.lang.String internedName)
Deprecated.
|
IRubyObject |
fastGetConstantFromConstMissing(java.lang.String internedName)
Deprecated.
|
IRubyObject |
fastGetConstantFromNoConstMissing(java.lang.String internedName)
Deprecated.
|
boolean |
fastHasClassVariable(java.lang.String internedName)
Deprecated.
|
boolean |
fastHasConstant(java.lang.String internedName)
Deprecated.
|
boolean |
fastIsClassVarDefined(java.lang.String internedName)
Deprecated.
|
boolean |
fastIsConstantDefined(java.lang.String internedName) |
boolean |
fastIsConstantDefined19(java.lang.String internedName) |
boolean |
fastIsConstantDefined19(java.lang.String internedName,
boolean inherit) |
IRubyObject |
fastSetClassVar(java.lang.String internedName,
IRubyObject value)
Deprecated.
|
IRubyObject |
fastSetConstant(java.lang.String internedName,
IRubyObject value)
Deprecated.
|
IRubyObject |
fastStoreClassVariable(java.lang.String internedName,
IRubyObject value)
Deprecated.
|
IRubyObject |
fastStoreConstant(java.lang.String internedName,
IRubyObject value)
Deprecated.
|
IRubyObject |
fetchClassVariable(java.lang.String name) |
IRubyObject |
fetchConstant(java.lang.String name) |
IRubyObject |
fetchConstant(java.lang.String name,
boolean includePrivate) |
RubyModule |
findImplementer(RubyModule clazz)
Find the given class in this hierarchy, considering modules along the way.
|
protected IRubyObject |
finishAutoload(java.lang.String name)
Extract an Object which is defined by autoload thread from autoloadMap and define it as a constant.
|
IRubyObject |
freeze(ThreadContext context)
rb_mod_freeze
|
java.util.List<IRubyObject> |
getAncestorList() |
IRubyObject |
getAutoloadConstant(java.lang.String name)
Get autoload constant.
|
protected IRubyObject |
getAutoloadConstant(java.lang.String name,
boolean loadConstant) |
protected RubyString |
getAutoloadFile(java.lang.String name) |
java.lang.String |
getBaseName()
Get the base name of this class, or null if it is an anonymous class.
|
boolean |
getCacheProxy()
Get whether this Java proxy class should try to keep its instances idempotent
and alive using the ObjectProxyCache.
|
int |
getCacheToken()
Deprecated.
|
RubyClass |
getClass(java.lang.String name)
Finds a class that is within the current module (or class).
|
ClassIndex |
getClassIndex()
Get the ClassIndex for this class.
|
IRubyObject |
getClassVar(IRubyObject nameObject,
java.lang.String name) |
IRubyObject |
getClassVar(java.lang.String name)
Retrieve the specified class variable, searching through this module, included modules, and supermodules.
|
java.util.List<java.lang.String> |
getClassVariableNameList() |
protected java.util.Map<java.lang.String,IRubyObject> |
getClassVariables() |
protected java.util.Map<java.lang.String,IRubyObject> |
getClassVariablesForRead() |
IRubyObject |
getClassVarQuiet(java.lang.String name) |
IRubyObject |
getConstant(java.lang.String name)
Retrieve the named constant, invoking 'const_missing' should that be appropriate.
|
IRubyObject |
getConstant(java.lang.String name,
boolean inherit) |
IRubyObject |
getConstant(java.lang.String name,
boolean inherit,
boolean includeObject) |
IRubyObject |
getConstantAt(java.lang.String name) |
IRubyObject |
getConstantAt(java.lang.String name,
boolean includePrivate) |
IRubyObject |
getConstantAtSpecial(java.lang.String name)
This version searches superclasses if we're starting with Object.
|
IRubyObject |
getConstantFrom(java.lang.String name) |
IRubyObject |
getConstantFromConstMissing(java.lang.String name) |
IRubyObject |
getConstantFromNoConstMissing(java.lang.String name) |
IRubyObject |
getConstantFromNoConstMissing(java.lang.String name,
boolean includePrivate) |
java.util.Map<java.lang.String,RubyModule.ConstantEntry> |
getConstantMap() |
java.util.Map<java.lang.String,RubyModule.ConstantEntry> |
getConstantMapForWrite() |
java.util.Collection<java.lang.String> |
getConstantNames() |
java.util.Collection<java.lang.String> |
getConstantNames(boolean includePrivate) |
IRubyObject |
getConstantNoConstMissing(java.lang.String name) |
IRubyObject |
getConstantNoConstMissing(java.lang.String name,
boolean inherit) |
IRubyObject |
getConstantNoConstMissing(java.lang.String name,
boolean inherit,
boolean includeObject) |
IRubyObject |
getConstantNoConstMissingSKipAutoload(java.lang.String name) |
RubyModule |
getDelegate() |
int |
getGeneration() |
java.lang.Integer |
getGenerationObject() |
java.lang.invoke.MethodHandle |
getIdTest() |
Invalidator |
getInvalidator() |
boolean |
getJavaProxy()
Get whether this class is associated with (i.e.
|
RubyModule |
getMethodLocation() |
java.util.Map<java.lang.String,DynamicMethod> |
getMethods() |
java.util.Map<java.lang.String,DynamicMethod> |
getMethodsForWrite() |
java.lang.String |
getName()
Generate a fully-qualified class name or a #-style name for anonymous and singleton classes.
|
ClassIndex |
getNativeClassIndex()
This is overridden in the other concrete Java builtins to provide a fast way
to determine what type they are.
|
RubyModule |
getNonIncludedClass() |
RubyModule |
getParent() |
java.util.Map<RubyModule,RubyModule> |
getRefinements() |
java.lang.String |
getSimpleName()
Get the "simple" name for the class, which is either the "base" name or
the "anonymous" class name.
|
java.util.List<Variable<IRubyObject>> |
getStoredConstantList()
Deprecated.
|
java.util.List<java.lang.String> |
getStoredConstantNameList()
Deprecated.
|
RubyClass |
getSuperClass()
Getter for property superClass.
|
boolean |
hasClassVariable(java.lang.String name) |
boolean |
hasConstant(java.lang.String name) |
RubyFixnum |
hash()
rb_obj_id
Will return the hash code of this object.
|
int |
hashCode()
This override does not do "checked" dispatch since Object usually has #hash defined.
|
boolean |
hasInternalModuleVariable(java.lang.String name)
Behaves similarly to
getClassVar(String) . |
boolean |
hasModuleInHierarchy(RubyModule type) |
boolean |
hasModuleInPrepends(RubyModule type) |
boolean |
hasPrepends() |
IRubyObject |
include_p(ThreadContext context,
IRubyObject arg) |
RubyModule |
include(IRubyObject[] modules)
rb_mod_include
|
RubyModule |
include(ThreadContext context,
IRubyObject module) |
RubyArray |
included_modules(ThreadContext context)
rb_mod_included_modules
|
IRubyObject |
included(ThreadContext context,
IRubyObject other) |
void |
includeModule(IRubyObject arg)
Include a new module in this module or class.
|
IRubyObject |
initialize_copy(IRubyObject original)
mri: rb_mod_init_copy
|
IRubyObject |
initialize(Block block)
Deprecated.
|
IRubyObject |
initialize(ThreadContext context,
Block block)
rb_mod_initialize
|
IRubyObject |
instance_method(IRubyObject symbol) |
RubyArray |
instance_methods(IRubyObject[] args) |
RubyArray |
instance_methods19(IRubyObject[] args) |
RubyArray |
instanceMethods(IRubyObject[] args,
Visibility visibility,
boolean obj,
boolean not) |
RubyArray |
instanceMethods(Visibility visibility,
boolean includeSuper,
boolean obj,
boolean not) |
void |
invalidateCacheDescendants() |
protected void |
invalidateCacheDescendantsInner()
Deprecated.
|
protected void |
invalidateConstantCache(java.lang.String constantName) |
protected void |
invalidateConstantCaches(java.util.Set<java.lang.String> constantNames) |
protected void |
invalidateCoreClasses() |
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(java.lang.String name)
Is class var defined?
Ruby C equivalent = "rb_cvar_defined"
|
boolean |
isConstantDefined(java.lang.String name)
rb_const_defined_at
|
boolean |
isIncluded()
Is this module one that in an included one (e.g.
|
boolean |
isInstance(IRubyObject object) |
boolean |
isKindOfModule(RubyModule type) |
boolean |
isMethodBound(java.lang.String name,
boolean checkVisibility)
MRI: rb_method_boundp
|
boolean |
isMethodBound(java.lang.String name,
boolean checkVisibility,
boolean checkRespondTo)
Deprecated.
|
boolean |
isMethodBuiltin(java.lang.String methodName)
Return true if the given method is defined on this class and is a builtin
(defined in Java at boot).
|
boolean |
isModule()
Specifically polymorphic method that are meant to be overridden
by modules to specify that they are modules in an easy way.
|
boolean |
isPrepended() |
boolean |
isRefinement() |
protected boolean |
isSame(RubyModule module) |
boolean |
isSingleton() |
boolean |
isSynchronized() |
static TypePopulator |
loadPopulatorFor(java.lang.Class<?> type) |
static void |
marshalTo(RubyModule module,
MarshalStream output) |
IRubyObject |
method_added(ThreadContext context,
IRubyObject nothing) |
RubyBoolean |
method_defined_p(ThreadContext context,
IRubyObject symbol) |
IRubyObject |
method_removed(ThreadContext context,
IRubyObject nothing) |
IRubyObject |
method_undefined(ThreadContext context,
IRubyObject nothing) |
IRubyObject |
mix(ThreadContext context,
IRubyObject mod) |
IRubyObject |
mix(ThreadContext context,
IRubyObject mod,
IRubyObject hash0) |
IRubyObject |
module_eval(ThreadContext context,
Block block) |
IRubyObject |
module_eval(ThreadContext context,
IRubyObject[] args,
Block block)
Deprecated.
|
IRubyObject |
module_eval(ThreadContext context,
IRubyObject arg0,
Block block) |
IRubyObject |
module_eval(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
Block block) |
IRubyObject |
module_eval(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
Block block) |
IRubyObject |
module_exec(ThreadContext context,
Block block) |
IRubyObject |
module_exec(ThreadContext context,
IRubyObject[] args,
Block block) |
RubyModule |
module_function(ThreadContext context,
IRubyObject[] args)
rb_mod_modfunc
|
IRubyObject |
name() |
IRubyObject |
name19() |
boolean |
needsImplementer() |
static RubyArray |
nesting(ThreadContext context,
IRubyObject recv,
Block block)
Return an array of nested modules or classes.
|
protected java.lang.invoke.MethodHandle |
newIdTest() |
IncludedModuleWrapper |
newIncludeClass(RubyClass superClazz)
Deprecated.
|
IRubyObject |
newMethod(IRubyObject receiver,
java.lang.String methodName,
boolean bound,
Visibility visibility) |
IRubyObject |
newMethod(IRubyObject receiver,
java.lang.String methodName,
boolean bound,
Visibility visibility,
boolean respondToMissing) |
IRubyObject |
newMethod(IRubyObject receiver,
java.lang.String methodName,
boolean bound,
Visibility visibility,
boolean respondToMissing,
boolean priv) |
static RubyModule |
newModule(Ruby runtime)
rb_module_new
|
static RubyModule |
newModule(Ruby runtime,
java.lang.String name,
RubyModule parent,
boolean setParent)
rb_module_new/rb_define_module_id/rb_name_class/rb_set_class_path
|
IRubyObject |
op_cmp(IRubyObject obj)
rb_mod_cmp
|
RubyBoolean |
op_eqq(ThreadContext context,
IRubyObject obj)
rb_mod_eqq
|
IRubyObject |
op_equal(ThreadContext context,
IRubyObject other)
rb_obj_equal
Will by default use identity equality to compare objects.
|
IRubyObject |
op_ge(IRubyObject obj)
rb_mod_ge
|
IRubyObject |
op_gt(IRubyObject obj)
rb_mod_gt
|
IRubyObject |
op_le(IRubyObject obj)
rb_mod_le
|
IRubyObject |
op_lt(IRubyObject obj)
rb_mod_lt
|
RubyModule |
prepend_features(IRubyObject include)
rb_mod_prepend_features
|
IRubyObject |
prepend(ThreadContext context,
IRubyObject[] modules) |
IRubyObject |
prepended(ThreadContext context,
IRubyObject other) |
void |
prependModule(IRubyObject arg)
Prepend a new module to this module or class.
|
RubyModule |
private_class_method(IRubyObject[] args) |
IRubyObject |
private_constant(ThreadContext context,
IRubyObject name) |
IRubyObject |
private_constant(ThreadContext context,
IRubyObject[] rubyNames) |
RubyArray |
private_instance_methods(IRubyObject[] args)
rb_class_private_instance_methods
|
RubyArray |
private_instance_methods19(IRubyObject[] args)
Deprecated.
|
IRubyObject |
private_method_defined(ThreadContext context,
IRubyObject symbol) |
RubyArray |
protected_instance_methods(IRubyObject[] args)
rb_class_protected_instance_methods
|
RubyArray |
protected_instance_methods19(IRubyObject[] args)
Deprecated.
|
IRubyObject |
protected_method_defined(ThreadContext context,
IRubyObject symbol) |
RubyModule |
public_class_method(IRubyObject[] args) |
IRubyObject |
public_constant(ThreadContext context,
IRubyObject name) |
IRubyObject |
public_constant(ThreadContext context,
IRubyObject[] rubyNames) |
IRubyObject |
public_instance_method(IRubyObject symbol) |
RubyArray |
public_instance_methods(IRubyObject[] args) |
RubyArray |
public_instance_methods19(IRubyObject[] args) |
IRubyObject |
public_method_defined(ThreadContext context,
IRubyObject symbol) |
void |
putAlias(java.lang.String id,
DynamicMethod method,
java.lang.String oldName) |
DynamicMethod |
putMethod(Ruby runtime,
java.lang.String id,
DynamicMethod method) |
RubyModule |
rbPrivate(ThreadContext context,
IRubyObject[] args)
rb_mod_private
|
RubyModule |
rbProtected(ThreadContext context,
IRubyObject[] args)
rb_mod_protected
|
RubyModule |
rbPublic(ThreadContext context,
IRubyObject[] args)
rb_mod_public
|
IRubyObject |
refine(ThreadContext context,
IRubyObject target,
Block block) |
IRubyObject |
remove_class_variable(ThreadContext context,
IRubyObject name)
rb_mod_remove_cvar
|
IRubyObject |
remove_class_variable19(ThreadContext context,
IRubyObject name) |
IRubyObject |
remove_const(ThreadContext context,
IRubyObject rubyName) |
RubyModule |
remove_method(ThreadContext context,
IRubyObject[] args) |
void |
removeClassProvider(ClassProvider provider) |
IRubyObject |
removeClassVariable(java.lang.String name) |
void |
removeMethod(ThreadContext context,
java.lang.String id) |
IRubyObject |
resolveUndefConstant(java.lang.String name) |
boolean |
respondsToMethod(java.lang.String name,
boolean checkVisibility) |
DynamicMethod |
retrieveMethod(java.lang.String name)
Search through this module and supermodules for method definitions.
|
RubyString |
rubyBaseName() |
RubyString |
rubyName()
Generate a fully-qualified class name or a #-style name for anonymous and singleton classes which
is properly encoded.
|
IRubyObject |
searchInternalModuleVariable(java.lang.String name)
Behaves similarly to
getClassVar(String) . |
DynamicMethod |
searchMethod(java.lang.String name)
Search through this module and supermodules for method definitions.
|
protected DynamicMethod |
searchMethodCommon(java.lang.String id) |
DynamicMethod |
searchMethodInner(java.lang.String id) |
DynamicMethod |
searchMethodWithRefinementsInner(java.lang.String name,
StaticScope refinedScope) |
CacheEntry |
searchWithCache(java.lang.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.
|
CacheEntry |
searchWithCache(java.lang.String id,
boolean cacheUndef)
Search through this module and supermodules for method definitions.
|
DynamicMethod |
searchWithRefinements(java.lang.String name,
StaticScope refinedScope)
Search for the named method in this class and in superclasses applying refinements from the given scope.
|
void |
setBaseName(java.lang.String name)
Set the base name of the class.
|
void |
setCacheProxy(boolean cacheProxy)
Set whether this Java proxy class should try to keep its instances idempotent
and alive using the ObjectProxyCache.
|
IRubyObject |
setClassVar(java.lang.String name,
IRubyObject value)
Set the named class variable to the given value, provided taint and freeze allow setting it.
|
IRubyObject |
setConstant(java.lang.String name,
IRubyObject value)
Set the named constant on this module.
|
IRubyObject |
setConstant(java.lang.String name,
IRubyObject value,
boolean hidden) |
IRubyObject |
setConstantQuiet(java.lang.String name,
IRubyObject value)
Set the named constant on this module.
|
void |
setConstantVisibility(Ruby runtime,
java.lang.String name,
boolean hidden) |
void |
setInternalModuleVariable(java.lang.String name,
IRubyObject value)
Behaves similarly to
setClassVar(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)
set_method_visibility
|
void |
setParent(RubyModule parent) |
void |
setRefinements(java.util.Map<RubyModule,RubyModule> refinements) |
void |
setSuperClass(RubyClass superClass) |
IRubyObject |
singleton_class_p(ThreadContext context) |
IRubyObject |
storeClassVariable(java.lang.String name,
IRubyObject value) |
IRubyObject |
storeConstant(java.lang.String name,
IRubyObject value) |
IRubyObject |
storeConstant(java.lang.String name,
IRubyObject value,
boolean hidden) |
void |
syncClassVariables(RubyModule other) |
void |
syncConstants(RubyModule other) |
RubyString |
to_s()
rb_mod_to_s
|
<T> T |
toJava(java.lang.Class<T> target)
Convert the object to the specified Java class, if possible.
|
RubyModule |
undef_method(ThreadContext context,
IRubyObject[] args) |
void |
undef(ThreadContext context,
java.lang.String name)
rb_undef
|
static java.lang.String |
undefinedMethodMessage(Ruby runtime,
IRubyObject name,
IRubyObject modName,
boolean isModule) |
void |
undefineMethod(java.lang.String name) |
static RubyModule |
unmarshalFrom(UnmarshalStream input) |
void |
updateGeneration() |
IRubyObject |
used_modules(ThreadContext context) |
IRubyObject |
using(ThreadContext context,
IRubyObject refinedModule) |
static void |
usingModule(ThreadContext context,
RubyModule cref,
IRubyObject refinedModule) |
protected java.lang.String |
validateClassVariable(IRubyObject nameObj,
java.lang.String name) |
protected java.lang.String |
validateClassVariable(Ruby runtime,
IRubyObject object) |
protected java.lang.String |
validateClassVariable(java.lang.String name) |
protected java.lang.String |
validateConstant(IRubyObject name)
Validates name is a valid constant name and returns its id string.
|
protected java.lang.String |
validateConstant(java.lang.String name,
IRubyObject errorName) |
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, eqlInternal, equalInternal, inspect, puts, specificEval, toRubyString, toString
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dup, ensureInstanceVariablesSettable, eql_p, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize19, inspect, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isFalse, isFrozen, isImmediate, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing, method_missing19, method, method19, methods, methods, methods19, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_cmp, op_equal_19, op_match, op_match19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, rbClone, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_method, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
public static final int CACHEPROXY_F
public static final int NEEDSIMPL_F
public static final int REFINED_MODULE_F
public static final int IS_OVERLAID_F
public static final int OMOD_SHARED
public static final ObjectAllocator MODULE_ALLOCATOR
protected static final RubyModule.CacheEntryFactory NormalCacheEntryFactory
public RubyModule.KindOf kindOf
public final int id
public RubyModule parent
protected java.lang.String baseName
protected volatile java.util.Map<java.lang.String,DynamicMethod> methods
protected java.util.Map<java.lang.String,CacheEntry> cachedMethods
protected int generation
protected java.lang.Integer generationObject
protected volatile java.util.Set<RubyClass> includingHierarchies
protected volatile RubyModule methodLocation
protected RubyClass superClass
@Deprecated public int index
ClassIndex
@Deprecated public static final java.util.Set<java.lang.String> SCOPE_CAPTURING_METHODS
protected ClassIndex classIndex
protected final Invalidator methodInvalidator
protected RubyModule(Ruby runtime, RubyClass metaClass, boolean objectSpace)
protected RubyModule(Ruby runtime, RubyClass metaClass)
protected RubyModule(Ruby runtime)
public void checkValidBindTargetFrom(ThreadContext context, RubyModule originModule) throws RaiseException
RaiseException
public ClassIndex getClassIndex()
public ClassIndex getNativeClassIndex()
RubyObject
getNativeClassIndex
in interface CoreObjectType
getNativeClassIndex
in class RubyObject
ClassIndex
public boolean isModule()
RubyBasicObject
isModule
in interface IRubyObject
isModule
in class RubyBasicObject
(someObject instanceof RubyModule)
instead.public boolean isClass()
RubyBasicObject
isClass
in interface IRubyObject
isClass
in class RubyBasicObject
(someObject instanceof RubyClass/MetaClass)
instead.public boolean isSingleton()
public boolean isInstance(IRubyObject object)
public java.util.Map<java.lang.String,RubyModule.ConstantEntry> getConstantMap()
public java.util.Map<java.lang.String,RubyModule.ConstantEntry> getConstantMapForWrite()
public void addIncludingHierarchy(IncludedModule hierarchy)
public final java.lang.invoke.MethodHandle getIdTest()
protected final java.lang.invoke.MethodHandle newIdTest()
public boolean needsImplementer()
public static RubyModule newModule(Ruby runtime)
public static RubyModule newModule(Ruby runtime, java.lang.String name, RubyModule parent, boolean setParent)
public final void addClassProvider(ClassProvider provider)
public final void removeClassProvider(ClassProvider provider)
protected void checkForCyclicPrepend(RubyModule m) throws RaiseException
RaiseException
public RubyClass getSuperClass()
public void setSuperClass(RubyClass superClass)
public RubyModule getParent()
public void setParent(RubyModule parent)
public RubyModule getMethodLocation()
public void setMethodLocation(RubyModule module)
public java.util.Map<java.lang.String,DynamicMethod> getMethods()
public java.util.Map<java.lang.String,DynamicMethod> getMethodsForWrite()
public DynamicMethod putMethod(Ruby runtime, java.lang.String id, DynamicMethod method)
runtime
- id
- identifier string (8859_1). Matching entry in symbol table.method
- public boolean isIncluded()
IncludedModuleWrapper
).IncludedModule
public boolean isPrepended()
public RubyModule getNonIncludedClass()
public RubyModule getDelegate()
public java.lang.String getBaseName()
public void setBaseName(java.lang.String name)
name
- the new base name of the classpublic java.lang.String getName()
public RubyString rubyName()
public RubyString rubyBaseName()
public java.lang.String getSimpleName()
public IRubyObject refine(ThreadContext context, IRubyObject target, Block block)
public IRubyObject using(ThreadContext context, IRubyObject refinedModule)
public static void usingModule(ThreadContext context, RubyModule cref, IRubyObject refinedModule)
public IRubyObject used_modules(ThreadContext context)
@Deprecated public IncludedModuleWrapper newIncludeClass(RubyClass superClazz)
public RubyClass getClass(java.lang.String name)
name
- to be found in this module (or class)@Deprecated public RubyClass fastGetClass(java.lang.String internedName)
public void prependModule(IRubyObject arg)
arg
- The module to includepublic void includeModule(IRubyObject arg)
arg
- The module to includepublic void defineAnnotatedMethod(java.lang.Class clazz, java.lang.String name)
public final void defineAnnotatedConstants(java.lang.Class clazz)
public final boolean defineAnnotatedConstant(java.lang.reflect.Field field)
public void defineAnnotatedMethods(java.lang.Class clazz)
public static TypePopulator loadPopulatorFor(java.lang.Class<?> type)
public final void defineAnnotatedMethodsIndividually(java.lang.Class clazz)
public final boolean defineAnnotatedMethod(java.lang.String name, java.util.List<JavaMethodDescriptor> methods, MethodFactory methodFactory)
public final boolean defineAnnotatedMethod(java.lang.reflect.Method method, MethodFactory methodFactory)
public final boolean defineAnnotatedMethod(java.lang.String name, JavaMethodDescriptor desc, MethodFactory methodFactory)
public void undefineMethod(java.lang.String name)
public void undef(ThreadContext context, java.lang.String name)
public IRubyObject include_p(ThreadContext context, IRubyObject arg)
public IRubyObject singleton_class_p(ThreadContext context)
public void addMethod(java.lang.String id, DynamicMethod method)
public final void addMethodInternal(java.lang.String name, DynamicMethod method)
public final void addMethodAtBootTimeOnly(java.lang.String id, DynamicMethod method)
id
- The name to which to bind the methodmethod
- The method to bindpublic void removeMethod(ThreadContext context, java.lang.String id)
public final DynamicMethod searchMethod(java.lang.String name)
name
- The name of the method to search forpublic CacheEntry searchWithCache(java.lang.String name)
name
- the method namepublic DynamicMethod searchWithRefinements(java.lang.String name, StaticScope refinedScope)
name
- the method namerefinedScope
- the scope containing refinements to searchpublic final CacheEntry searchWithCache(java.lang.String id, boolean cacheUndef)
id
- The name of the method to search forcacheUndef
- Flag for caching UndefinedMethod. This should normally be true.@Deprecated public final int getCacheToken()
public final int getGeneration()
public final java.lang.Integer getGenerationObject()
public void becomeSynchronized()
public boolean isSynchronized()
public DynamicMethod searchMethodInner(java.lang.String id)
public DynamicMethod searchMethodWithRefinementsInner(java.lang.String name, StaticScope refinedScope)
protected DynamicMethod searchMethodCommon(java.lang.String id)
public void invalidateCacheDescendants()
protected void invalidateCoreClasses()
public Invalidator getInvalidator()
public void updateGeneration()
@Deprecated protected void invalidateCacheDescendantsInner()
protected void invalidateConstantCache(java.lang.String constantName)
protected void invalidateConstantCaches(java.util.Set<java.lang.String> constantNames)
public DynamicMethod retrieveMethod(java.lang.String name)
name
- The name of the method to search forpublic RubyModule findImplementer(RubyModule clazz)
clazz
- the class to findpublic void addModuleFunction(java.lang.String name, DynamicMethod method)
public void defineAlias(java.lang.String name, java.lang.String oldName)
public void putAlias(java.lang.String id, DynamicMethod method, java.lang.String oldName)
id
- method
- oldName
- public void defineAliases(java.util.List<java.lang.String> aliases, java.lang.String oldId)
public RubyClass defineOrGetClassUnder(java.lang.String name, RubyClass superClazz)
public RubyClass defineOrGetClassUnder(java.lang.String name, RubyClass superClazz, ObjectAllocator allocator)
public RubyModule defineOrGetModuleUnder(java.lang.String name)
public RubyClass defineClassUnder(java.lang.String name, RubyClass superClass, ObjectAllocator allocator)
public RubyModule defineModuleUnder(java.lang.String name)
public void setMethodVisibility(IRubyObject[] methods, Visibility visibility)
public void exportMethod(java.lang.String name, Visibility visibility)
public static java.lang.String undefinedMethodMessage(Ruby runtime, IRubyObject name, IRubyObject modName, boolean isModule)
public boolean isMethodBound(java.lang.String name, boolean checkVisibility)
public boolean respondsToMethod(java.lang.String name, boolean checkVisibility)
@Deprecated public boolean isMethodBound(java.lang.String name, boolean checkVisibility, boolean checkRespondTo)
public final IRubyObject newMethod(IRubyObject receiver, java.lang.String methodName, boolean bound, Visibility visibility)
public final IRubyObject newMethod(IRubyObject receiver, java.lang.String methodName, boolean bound, Visibility visibility, boolean respondToMissing)
public IRubyObject newMethod(IRubyObject receiver, java.lang.String methodName, boolean bound, Visibility visibility, boolean respondToMissing, boolean priv)
public IRubyObject define_method(ThreadContext context, IRubyObject arg0, Block block)
public IRubyObject defineMethodFromBlock(ThreadContext context, IRubyObject arg0, Block block, Visibility visibility)
public IRubyObject define_method(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
public IRubyObject defineMethodFromCallable(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Visibility visibility)
@Deprecated public IRubyObject define_method(ThreadContext context, IRubyObject[] args, Block block)
public IRubyObject name()
public IRubyObject name19()
protected IRubyObject cloneMethods(RubyModule clone)
public IRubyObject initialize_copy(IRubyObject original)
initialize_copy
in class RubyBasicObject
public void syncConstants(RubyModule other)
public void syncClassVariables(RubyModule other)
public RubyArray included_modules(ThreadContext context)
public boolean hasPrepends()
public RubyArray ancestors(ThreadContext context)
@Deprecated public RubyArray ancestors()
public java.util.List<IRubyObject> getAncestorList()
public boolean hasModuleInPrepends(RubyModule type)
public boolean hasModuleInHierarchy(RubyModule type)
public int hashCode()
RubyObject
hashCode
in class RubyObject
RubyBasicObject.hashCode()
public RubyFixnum hash()
RubyBasicObject
hash
in class RubyBasicObject
public RubyString to_s()
to_s
in class RubyBasicObject
public RubyBoolean op_eqq(ThreadContext context, IRubyObject obj)
op_eqq
in interface IRubyObject
op_eqq
in class RubyObject
public boolean equals(java.lang.Object other)
equals
in class RubyObject
other
- The object to check for equalityRubyBasicObject.equals(Object)
public IRubyObject op_equal(ThreadContext context, IRubyObject other)
RubyBasicObject
op_equal
in interface IRubyObject
op_equal
in class RubyBasicObject
public final IRubyObject freeze(ThreadContext context)
freeze
in class RubyBasicObject
public IRubyObject op_le(IRubyObject obj)
public IRubyObject op_lt(IRubyObject obj)
public IRubyObject op_ge(IRubyObject obj)
public IRubyObject op_gt(IRubyObject obj)
public IRubyObject op_cmp(IRubyObject obj)
public boolean isKindOfModule(RubyModule type)
protected boolean isSame(RubyModule module)
public IRubyObject initialize(ThreadContext context, Block block)
public void addReadWriteAttribute(ThreadContext context, java.lang.String name)
public void addReadAttribute(ThreadContext context, java.lang.String name)
public void addWriteAttribute(ThreadContext context, java.lang.String name)
public IRubyObject attr(ThreadContext context, IRubyObject[] args)
@Deprecated public IRubyObject attr19(ThreadContext context, IRubyObject[] args)
@Deprecated public IRubyObject attr_reader(IRubyObject[] args)
public IRubyObject attr_reader(ThreadContext context, IRubyObject[] args)
public IRubyObject attr_writer(ThreadContext context, IRubyObject[] args)
@Deprecated public IRubyObject attr_accessor(IRubyObject[] args)
public IRubyObject attr_accessor(ThreadContext context, IRubyObject[] args)
public RubyArray instanceMethods(IRubyObject[] args, Visibility visibility, boolean obj, boolean not)
public RubyArray instanceMethods(Visibility visibility, boolean includeSuper, boolean obj, boolean not)
protected void addMethodSymbols(Ruby runtime, java.util.Set<java.lang.String> seen, RubyArray ary, boolean not, Visibility visibility)
public RubyArray instance_methods(IRubyObject[] args)
public RubyArray instance_methods19(IRubyObject[] args)
public RubyArray public_instance_methods(IRubyObject[] args)
public RubyArray public_instance_methods19(IRubyObject[] args)
public IRubyObject instance_method(IRubyObject symbol)
public IRubyObject public_instance_method(IRubyObject symbol)
public RubyArray protected_instance_methods(IRubyObject[] args)
@Deprecated public RubyArray protected_instance_methods19(IRubyObject[] args)
public RubyArray private_instance_methods(IRubyObject[] args)
@Deprecated public RubyArray private_instance_methods19(IRubyObject[] args)
public RubyModule prepend_features(IRubyObject include)
public RubyModule append_features(IRubyObject include)
public IRubyObject extend_object(IRubyObject obj)
public RubyModule include(IRubyObject[] modules)
public RubyModule include(ThreadContext context, IRubyObject module)
public IRubyObject included(ThreadContext context, IRubyObject other)
public IRubyObject extended(ThreadContext context, IRubyObject other, Block block)
public IRubyObject mix(ThreadContext context, IRubyObject mod)
public IRubyObject mix(ThreadContext context, IRubyObject mod, IRubyObject hash0)
public RubyModule rbPublic(ThreadContext context, IRubyObject[] args)
public RubyModule rbProtected(ThreadContext context, IRubyObject[] args)
public RubyModule rbPrivate(ThreadContext context, IRubyObject[] args)
public RubyModule module_function(ThreadContext context, IRubyObject[] args)
public IRubyObject method_added(ThreadContext context, IRubyObject nothing)
public IRubyObject method_removed(ThreadContext context, IRubyObject nothing)
public IRubyObject method_undefined(ThreadContext context, IRubyObject nothing)
public RubyBoolean method_defined_p(ThreadContext context, IRubyObject symbol)
public IRubyObject public_method_defined(ThreadContext context, IRubyObject symbol)
public IRubyObject protected_method_defined(ThreadContext context, IRubyObject symbol)
public IRubyObject private_method_defined(ThreadContext context, IRubyObject symbol)
public RubyModule public_class_method(IRubyObject[] args)
public RubyModule private_class_method(IRubyObject[] args)
public RubyModule alias_method(ThreadContext context, IRubyObject newId, IRubyObject oldId)
public RubyModule undef_method(ThreadContext context, IRubyObject[] args)
public IRubyObject module_eval(ThreadContext context, Block block)
public IRubyObject module_eval(ThreadContext context, IRubyObject arg0, Block block)
public IRubyObject module_eval(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
public IRubyObject module_eval(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
@Deprecated public IRubyObject module_eval(ThreadContext context, IRubyObject[] args, Block block)
public IRubyObject module_exec(ThreadContext context, Block block)
public IRubyObject module_exec(ThreadContext context, IRubyObject[] args, Block block)
public RubyModule remove_method(ThreadContext context, IRubyObject[] args)
public static void marshalTo(RubyModule module, MarshalStream output) throws java.io.IOException
java.io.IOException
public static RubyModule unmarshalFrom(UnmarshalStream input) throws java.io.IOException
java.io.IOException
public static RubyArray nesting(ThreadContext context, IRubyObject recv, Block block)
public IRubyObject class_variable_defined_p(ThreadContext context, IRubyObject var)
public IRubyObject class_variable_get(IRubyObject name)
public IRubyObject class_variable_get19(IRubyObject name)
public IRubyObject class_variable_set(IRubyObject name, IRubyObject value)
public IRubyObject class_variable_set19(IRubyObject name, IRubyObject value)
public IRubyObject remove_class_variable(ThreadContext context, IRubyObject name)
public IRubyObject remove_class_variable19(ThreadContext context, IRubyObject name)
@Deprecated public RubyArray class_variables19(ThreadContext context)
public RubyArray class_variables(ThreadContext context)
public RubyArray class_variables(ThreadContext context, IRubyObject inherit)
public RubyBoolean const_defined_p(ThreadContext context, IRubyObject symbol)
public RubyBoolean const_defined_p19(ThreadContext context, IRubyObject[] args)
public IRubyObject const_get(IRubyObject symbol)
public IRubyObject const_get_1_9(ThreadContext context, IRubyObject[] args)
public IRubyObject const_get_2_0(ThreadContext context, IRubyObject[] args)
public IRubyObject const_set(IRubyObject name, IRubyObject value)
public IRubyObject remove_const(ThreadContext context, IRubyObject rubyName)
public IRubyObject const_missing(ThreadContext context, IRubyObject rubyName, Block block)
rubyName
- The constant name which was found to be missingpublic RubyArray constants(ThreadContext context)
public RubyArray constants(ThreadContext context, IRubyObject allConstants)
@Deprecated public RubyArray constants19(ThreadContext context)
@Deprecated public RubyArray constants19(ThreadContext context, IRubyObject allConstants)
@Deprecated public RubyArray constantsCommon19(ThreadContext context, boolean replaceModule, boolean allConstants)
public java.util.Collection<java.lang.String> constantsCommon(Ruby runtime, boolean replaceModule, boolean allConstants)
public java.util.Collection<java.lang.String> constantsCommon(Ruby runtime, boolean replaceModule, boolean allConstants, boolean includePrivate)
public void deprecateConstant(Ruby runtime, java.lang.String name)
public IRubyObject deprecate_constant(ThreadContext context, IRubyObject name)
public IRubyObject deprecate_constant(ThreadContext context, IRubyObject[] names)
public IRubyObject private_constant(ThreadContext context, IRubyObject name)
public IRubyObject private_constant(ThreadContext context, IRubyObject[] rubyNames)
public IRubyObject public_constant(ThreadContext context, IRubyObject name)
public IRubyObject public_constant(ThreadContext context, IRubyObject[] rubyNames)
public IRubyObject prepend(ThreadContext context, IRubyObject[] modules)
public IRubyObject prepended(ThreadContext context, IRubyObject other)
public final void setConstantVisibility(Ruby runtime, java.lang.String name, boolean hidden)
public IRubyObject setClassVar(java.lang.String name, IRubyObject value)
name
- The variable name to setvalue
- The value to set it to@Deprecated public IRubyObject fastSetClassVar(java.lang.String internedName, IRubyObject value)
public IRubyObject getClassVar(java.lang.String name)
name
- The name of the variable to retrievepublic IRubyObject getClassVar(IRubyObject nameObject, java.lang.String name)
public IRubyObject getClassVarQuiet(java.lang.String name)
@Deprecated public IRubyObject fastGetClassVar(java.lang.String internedName)
public boolean isClassVarDefined(java.lang.String name)
name
- The class var to determine "is defined?"@Deprecated public boolean fastIsClassVarDefined(java.lang.String internedName)
public IRubyObject removeClassVariable(java.lang.String name)
public IRubyObject getConstantAtSpecial(java.lang.String name)
name
- the constant name to findpublic IRubyObject getConstantAt(java.lang.String name)
public IRubyObject getConstantAt(java.lang.String name, boolean includePrivate)
@Deprecated public IRubyObject fastGetConstantAt(java.lang.String internedName)
public IRubyObject getConstant(java.lang.String name)
name
- The constant to retrievepublic IRubyObject getConstant(java.lang.String name, boolean inherit)
public IRubyObject getConstant(java.lang.String name, boolean inherit, boolean includeObject)
@Deprecated public IRubyObject fastGetConstant(java.lang.String internedName)
@Deprecated public IRubyObject fastGetConstant(java.lang.String internedName, boolean inherit)
public IRubyObject getConstantNoConstMissing(java.lang.String name)
public IRubyObject getConstantNoConstMissing(java.lang.String name, boolean inherit)
public IRubyObject getConstantNoConstMissingSKipAutoload(java.lang.String name)
public IRubyObject getConstantNoConstMissing(java.lang.String name, boolean inherit, boolean includeObject)
public IRubyObject getConstantFrom(java.lang.String name)
@Deprecated public IRubyObject fastGetConstantFrom(java.lang.String internedName)
public IRubyObject getConstantFromNoConstMissing(java.lang.String name)
public IRubyObject getConstantFromNoConstMissing(java.lang.String name, boolean includePrivate)
@Deprecated public IRubyObject fastGetConstantFromNoConstMissing(java.lang.String internedName)
public IRubyObject getConstantFromConstMissing(java.lang.String name)
@Deprecated public IRubyObject fastGetConstantFromConstMissing(java.lang.String internedName)
public final IRubyObject resolveUndefConstant(java.lang.String name)
public IRubyObject setConstantQuiet(java.lang.String name, IRubyObject value)
name
- The name to assignvalue
- The value to assign to it; if an unnamed Module, also set its basename to namepublic IRubyObject setConstant(java.lang.String name, IRubyObject value)
name
- The name to assignvalue
- The value to assign to it; if an unnamed Module, also set its basename to namepublic IRubyObject setConstant(java.lang.String name, IRubyObject value, boolean hidden)
@Deprecated public IRubyObject fastSetConstant(java.lang.String internedName, IRubyObject value)
public void defineConstant(java.lang.String name, IRubyObject value)
public boolean isConstantDefined(java.lang.String name)
public boolean fastIsConstantDefined(java.lang.String internedName)
public boolean fastIsConstantDefined19(java.lang.String internedName)
public boolean fastIsConstantDefined19(java.lang.String internedName, boolean inherit)
public boolean hasInternalModuleVariable(java.lang.String name)
getClassVar(String)
. Searches this
class/module and its ancestors for the specified internal
variable.name
- the internal variable namesetInternalModuleVariable(String, IRubyObject)
public IRubyObject searchInternalModuleVariable(java.lang.String name)
getClassVar(String)
. Searches this
class/module and its ancestors for the specified internal
variable.name
- the internal variable namesetInternalModuleVariable(String, IRubyObject)
public void setInternalModuleVariable(java.lang.String name, IRubyObject value)
setClassVar(String, IRubyObject)
. If the
specified internal variable is found in this class/module or an ancestor,
it is set where found. Otherwise it is set in this module.name
- the internal variable namevalue
- the internal variable valuesearchInternalModuleVariable(String)
protected java.util.Map<java.lang.String,IRubyObject> getClassVariables()
protected java.util.Map<java.lang.String,IRubyObject> getClassVariablesForRead()
public boolean hasClassVariable(java.lang.String name)
@Deprecated public boolean fastHasClassVariable(java.lang.String internedName)
public IRubyObject fetchClassVariable(java.lang.String name)
@Deprecated public IRubyObject fastFetchClassVariable(java.lang.String internedName)
public IRubyObject storeClassVariable(java.lang.String name, IRubyObject value)
@Deprecated public IRubyObject fastStoreClassVariable(java.lang.String internedName, IRubyObject value)
public IRubyObject deleteClassVariable(java.lang.String name)
public java.util.List<java.lang.String> getClassVariableNameList()
protected final java.lang.String validateClassVariable(java.lang.String name)
protected final java.lang.String validateClassVariable(IRubyObject nameObj, java.lang.String name)
protected java.lang.String validateClassVariable(Ruby runtime, IRubyObject object)
protected final void ensureClassVariablesSettable()
public boolean hasConstant(java.lang.String name)
@Deprecated public boolean fastHasConstant(java.lang.String internedName)
public IRubyObject fetchConstant(java.lang.String name)
public IRubyObject fetchConstant(java.lang.String name, boolean includePrivate)
@Deprecated public IRubyObject fastFetchConstant(java.lang.String internedName)
public IRubyObject storeConstant(java.lang.String name, IRubyObject value)
public IRubyObject storeConstant(java.lang.String name, IRubyObject value, boolean hidden)
@Deprecated public IRubyObject fastStoreConstant(java.lang.String internedName, IRubyObject value)
public IRubyObject deleteConstant(java.lang.String name)
@Deprecated public java.util.List<Variable<IRubyObject>> getStoredConstantList()
@Deprecated public java.util.List<java.lang.String> getStoredConstantNameList()
public java.util.Collection<java.lang.String> getConstantNames()
public java.util.Collection<java.lang.String> getConstantNames(boolean includePrivate)
protected final java.lang.String validateConstant(IRubyObject name)
name
- object to verify as a valid constant.protected final java.lang.String validateConstant(java.lang.String name, IRubyObject errorName)
protected final void ensureConstantsSettable()
public final void checkFrozen()
RubyBasicObject
RubyBasicObject.testFrozen(java.lang.String)
.checkFrozen
in class RubyBasicObject
protected boolean constantTableContains(java.lang.String name)
protected IRubyObject constantTableFetch(java.lang.String name)
protected RubyModule.ConstantEntry constantEntryFetch(java.lang.String name)
protected IRubyObject constantTableStore(java.lang.String name, IRubyObject value)
protected IRubyObject constantTableStore(java.lang.String name, IRubyObject value, boolean hidden)
protected IRubyObject constantTableStore(java.lang.String name, IRubyObject value, boolean hidden, boolean deprecated)
protected IRubyObject constantTableRemove(java.lang.String name)
protected final void defineAutoload(java.lang.String name, RubyModule.AutoloadMethod loadMethod)
protected final IRubyObject finishAutoload(java.lang.String name)
public final IRubyObject getAutoloadConstant(java.lang.String name)
protected IRubyObject getAutoloadConstant(java.lang.String name, boolean loadConstant)
protected RubyString getAutoloadFile(java.lang.String name)
@Deprecated public IRubyObject initialize(Block block)
public void setJavaProxy(boolean javaProxy)
public boolean getJavaProxy()
public boolean getCacheProxy()
public void setCacheProxy(boolean cacheProxy)
public <T> T toJava(java.lang.Class<T> target)
IRubyObject
toJava
in interface IRubyObject
toJava
in class RubyBasicObject
target
- The target type to which the object should be converted.IRubyObject.toJava(java.lang.Class<T>)
public java.util.Set<java.lang.String> discoverInstanceVariables()
public boolean isRefinement()
public boolean isMethodBuiltin(java.lang.String methodName)
methodName
- public java.util.Map<RubyModule,RubyModule> getRefinements()
public void setRefinements(java.util.Map<RubyModule,RubyModule> refinements)
Copyright © 2001-2018 JRuby. All Rights Reserved.