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 String |
baseName
The base name of this class/module, excluding nesting.
|
protected Map<String,CacheEntry> |
cachedMethods |
protected ClassIndex |
classIndex |
protected static String |
ERR_INSECURE_SET_CONSTANT |
protected int |
generation |
protected Integer |
generationObject |
int |
id |
protected Set<RubyClass> |
includingHierarchies |
int |
index
Deprecated.
use RubyModule#getClassIndex()
|
RubyModule.KindOf |
kindOf |
protected Invalidator |
methodInvalidator |
protected RubyModule |
methodLocation |
protected Map<String,DynamicMethod> |
methods |
static ObjectAllocator |
MODULE_ALLOCATOR |
protected static RubyModule.CacheEntryFactory |
NormalCacheEntryFactory |
RubyModule |
parent
The class/module within whose namespace this class/module resides.
|
static Set<String> |
SCOPE_CAPTURING_METHODS
Deprecated.
|
protected RubyClass |
superClass |
FIELD_ALLOCATED_CLASSES, FIELD_ALLOCATORS, IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, OBJECT_VAR0_ALLOCATOR, OBJECT_VAR1_ALLOCATOR, OBJECT_VAR2_ALLOCATOR, OBJECT_VAR3_ALLOCATOR, OBJECT_VAR4_ALLOCATOR, OBJECT_VAR5_ALLOCATOR, OBJECT_VAR6_ALLOCATOR, OBJECT_VAR7_ALLOCATOR, OBJECT_VAR8_ALLOCATOR, OBJECT_VAR9_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_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
|
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, initialize, initialize, inspect, puts, specificEval, toString
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, 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, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id, infectBy, 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, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, 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, 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_added19, singleton_method_removed19, singleton_method_undefined19, 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, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
protected static final String ERR_INSECURE_SET_CONSTANT
public static final ObjectAllocator MODULE_ALLOCATOR
protected static final RubyModule.CacheEntryFactory NormalCacheEntryFactory
public RubyModule.KindOf kindOf
public final int id
public RubyModule parent
protected String baseName
protected volatile Map<String,DynamicMethod> methods
protected Map<String,CacheEntry> cachedMethods
protected int generation
protected Integer generationObject
protected volatile RubyModule methodLocation
protected RubyClass superClass
@Deprecated public int index
ClassIndex
@Deprecated public static final Set<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 Map<String,RubyModule.ConstantEntry> getConstantMap()
public Map<String,RubyModule.ConstantEntry> getConstantMapForWrite()
public void addIncludingHierarchy(IncludedModule hierarchy)
public boolean needsImplementer()
public static RubyModule newModule(Ruby runtime)
public static RubyModule newModule(Ruby runtime, String name, RubyModule parent, boolean setParent)
public void addClassProvider(ClassProvider provider)
public 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 Map<String,DynamicMethod> getMethods()
public Map<String,DynamicMethod> getMethodsForWrite()
public boolean isIncluded()
IncludedModuleWrapper
).IncludedModule
public boolean isPrepended()
public RubyModule getNonIncludedClass()
public RubyModule getDelegate()
public RubyModule getNonPrependedClass()
public String getBaseName()
public void setBaseName(String name)
name
- the new base name of the classpublic String getName()
public String getSimpleName()
public IRubyObject refine(ThreadContext context, IRubyObject classArg, Block block)
public IRubyObject using(ThreadContext context, IRubyObject refinedModule)
public static void usingModule(ThreadContext context, RubyModule cref, IRubyObject refinedModule)
@Deprecated public IncludedModuleWrapper newIncludeClass(RubyClass superClazz)
public RubyClass getClass(String name)
name
- to be found in this module (or class)@Deprecated public RubyClass fastGetClass(String internedName)
public void prependModule(IRubyObject arg)
arg
- The module to includepublic void includeModule(IRubyObject arg)
arg
- The module to includepublic void defineAnnotatedConstants(Class clazz)
public boolean defineAnnotatedConstant(Field field)
public void defineAnnotatedMethods(Class clazz)
public void defineAnnotatedMethodsIndividually(Class clazz)
public boolean defineAnnotatedMethod(String name, List<JavaMethodDescriptor> methods, MethodFactory methodFactory)
public boolean defineAnnotatedMethod(Method method, MethodFactory methodFactory)
public boolean defineAnnotatedMethod(String name, JavaMethodDescriptor desc, MethodFactory methodFactory)
public void undefineMethod(String name)
public void undef(ThreadContext context, String name)
public IRubyObject include_p(ThreadContext context, IRubyObject arg)
public IRubyObject singleton_class_p(ThreadContext context)
public void addMethod(String name, DynamicMethod method)
public void addMethodInternal(String name, DynamicMethod method)
public void addMethodAtBootTimeOnly(String name, DynamicMethod method)
name
- The name to which to bind the methodmethod
- The method to bindpublic void removeMethod(ThreadContext context, String name)
public DynamicMethod searchMethod(String name)
name
- The name of the method to search forpublic CacheEntry searchWithCache(String name)
public CacheEntry searchWithCache(String name, boolean cacheUndef)
name
- 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 Integer getGenerationObject()
public void becomeSynchronized()
public boolean isSynchronized()
public DynamicMethod searchMethodInner(String name)
protected DynamicMethod searchMethodCommon(String name)
public void invalidateCacheDescendants()
protected void invalidateCoreClasses()
public Invalidator getInvalidator()
public void updateGeneration()
@Deprecated protected void invalidateCacheDescendantsInner()
protected void invalidateConstantCache(String constantName)
public DynamicMethod retrieveMethod(String name)
name
- The name of the method to search forpublic RubyModule findImplementer(RubyModule clazz)
clazz
- the class to findpublic void addModuleFunction(String name, DynamicMethod method)
public RubyClass defineOrGetClassUnder(String name, RubyClass superClazz)
public RubyModule defineOrGetModuleUnder(String name)
public RubyClass defineClassUnder(String name, RubyClass superClass, ObjectAllocator allocator)
public RubyModule defineModuleUnder(String name)
public void setMethodVisibility(IRubyObject[] methods, Visibility visibility)
public void exportMethod(String name, Visibility visibility)
public boolean isMethodBound(String name, boolean checkVisibility)
public boolean isMethodBound(String name, boolean checkVisibility, boolean checkRespondTo)
public IRubyObject newMethod(IRubyObject receiver, String methodName, boolean bound, Visibility visibility)
public IRubyObject newMethod(IRubyObject receiver, String methodName, boolean bound, Visibility visibility, boolean respondToMissing)
public IRubyObject newMethod(IRubyObject receiver, String methodName, boolean bound, Visibility visibility, boolean respondToMissing, boolean priv)
public IRubyObject define_method(ThreadContext context, IRubyObject arg0, Block block)
public IRubyObject define_method(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
@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 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 IRubyObject 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(Object other)
equals
in class RubyObject
other
- The object to check for equalityRubyBasicObject.equals(Object)
public IRubyObject op_equal(ThreadContext context, IRubyObject other)
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, String name)
public void addReadAttribute(ThreadContext context, String name)
public void addWriteAttribute(ThreadContext context, String name)
public IRubyObject attr(ThreadContext context, IRubyObject[] args)
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)
public void populateInstanceMethodNames(Set<String> seen, RubyArray ary, Visibility visibility, boolean obj, boolean not, boolean recur)
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)
public RubyArray protected_instance_methods19(IRubyObject[] args)
public RubyArray private_instance_methods(IRubyObject[] args)
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 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 IOException
IOException
public static RubyModule unmarshalFrom(UnmarshalStream input) throws IOException
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 var)
public IRubyObject class_variable_get19(IRubyObject var)
public IRubyObject class_variable_set(IRubyObject var, IRubyObject value)
public IRubyObject class_variable_set19(IRubyObject var, 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 symbol, 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 constants19(ThreadContext context)
public RubyArray constants19(ThreadContext context, IRubyObject allConstants)
public RubyArray constantsCommon19(ThreadContext context, boolean replaceModule, boolean allConstants)
public Collection<String> constantsCommon(Ruby runtime, boolean replaceModule, boolean allConstants)
public Collection<String> constantsCommon(Ruby runtime, boolean replaceModule, boolean allConstants, boolean includePrivate)
public IRubyObject private_constant(ThreadContext context, IRubyObject rubyName)
public IRubyObject private_constant(ThreadContext context, IRubyObject[] rubyNames)
public IRubyObject public_constant(ThreadContext context, IRubyObject rubyName)
public IRubyObject public_constant(ThreadContext context, IRubyObject[] rubyNames)
public IRubyObject prepend(ThreadContext context, IRubyObject[] modules)
public IRubyObject prepended(ThreadContext context, IRubyObject other)
public IRubyObject setClassVar(String name, IRubyObject value)
name
- The variable name to setvalue
- The value to set it to@Deprecated public IRubyObject fastSetClassVar(String internedName, IRubyObject value)
public IRubyObject getClassVar(String name)
name
- The name of the variable to retrieve@Deprecated public IRubyObject fastGetClassVar(String internedName)
public boolean isClassVarDefined(String name)
name
- The class var to determine "is defined?"@Deprecated public boolean fastIsClassVarDefined(String internedName)
@Deprecated public IRubyObject removeCvar(IRubyObject name)
removeClassVariable(String)
public IRubyObject removeClassVariable(String name)
public IRubyObject getConstantAtSpecial(String name)
name
- the constant name to findpublic IRubyObject getConstantAt(String name)
public IRubyObject getConstantAt(String name, boolean includePrivate)
@Deprecated public IRubyObject fastGetConstantAt(String internedName)
public IRubyObject getConstant(String name)
name
- The constant to retrievepublic IRubyObject getConstant(String name, boolean inherit)
public IRubyObject getConstant(String name, boolean inherit, boolean includeObject)
@Deprecated public IRubyObject fastGetConstant(String internedName)
@Deprecated public IRubyObject fastGetConstant(String internedName, boolean inherit)
public IRubyObject getConstantNoConstMissing(String name)
public IRubyObject getConstantNoConstMissing(String name, boolean inherit)
public IRubyObject getConstantNoConstMissing(String name, boolean inherit, boolean includeObject)
public IRubyObject getConstantFrom(String name)
@Deprecated public IRubyObject fastGetConstantFrom(String internedName)
public IRubyObject getConstantFromNoConstMissing(String name)
public IRubyObject getConstantFromNoConstMissing(String name, boolean includePrivate)
@Deprecated public IRubyObject fastGetConstantFromNoConstMissing(String internedName)
public IRubyObject getConstantFromConstMissing(String name)
@Deprecated public IRubyObject fastGetConstantFromConstMissing(String internedName)
public final IRubyObject resolveUndefConstant(String name)
public IRubyObject setConstantQuiet(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(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(String name, IRubyObject value, boolean hidden)
@Deprecated public IRubyObject fastSetConstant(String internedName, IRubyObject value)
public void defineConstant(String name, IRubyObject value)
public boolean isConstantDefined(String name)
public boolean fastIsConstantDefined(String internedName)
public boolean fastIsConstantDefined19(String internedName)
public boolean fastIsConstantDefined19(String internedName, boolean inherit)
public boolean hasInternalModuleVariable(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(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(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 Map<String,IRubyObject> getClassVariables()
protected Map<String,IRubyObject> getClassVariablesForRead()
public boolean hasClassVariable(String name)
@Deprecated public boolean fastHasClassVariable(String internedName)
public IRubyObject fetchClassVariable(String name)
@Deprecated public IRubyObject fastFetchClassVariable(String internedName)
public IRubyObject storeClassVariable(String name, IRubyObject value)
@Deprecated public IRubyObject fastStoreClassVariable(String internedName, IRubyObject value)
public IRubyObject deleteClassVariable(String name)
protected final void ensureClassVariablesSettable()
public boolean hasConstant(String name)
@Deprecated public boolean fastHasConstant(String internedName)
public IRubyObject fetchConstant(String name)
public IRubyObject fetchConstant(String name, boolean includePrivate)
@Deprecated public IRubyObject fastFetchConstant(String internedName)
public IRubyObject storeConstant(String name, IRubyObject value)
public IRubyObject storeConstant(String name, IRubyObject value, boolean hidden)
@Deprecated public IRubyObject fastStoreConstant(String internedName, IRubyObject value)
public IRubyObject deleteConstant(String name)
@Deprecated public List<Variable<IRubyObject>> getStoredConstantList()
@Deprecated public List<String> getStoredConstantNameList()
public Collection<String> getConstantNames()
public Collection<String> getConstantNames(boolean includePrivate)
protected final String validateConstant(IRubyObject name)
protected final String validateConstant(String name, IRubyObject errorName)
protected final void ensureConstantsSettable()
protected boolean constantTableContains(String name)
protected IRubyObject constantTableFetch(String name)
protected RubyModule.ConstantEntry constantEntryFetch(String name)
protected IRubyObject constantTableStore(String name, IRubyObject value)
protected IRubyObject constantTableStore(String name, IRubyObject value, boolean hidden)
protected IRubyObject constantTableRemove(String name)
protected final void defineAutoload(String name, RubyModule.AutoloadMethod loadMethod)
protected final IRubyObject finishAutoload(String name)
public final IRubyObject getAutoloadConstant(String name)
protected IRubyObject getAutoloadConstant(String name, boolean loadConstant)
protected RubyString getAutoloadFile(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 Object toJava(Class 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)
public boolean isRefinement()
public boolean isMethodBuiltin(String methodName)
methodName
- public Map<RubyClass,RubyModule> getRefinements()
public void setRefinements(Map<RubyClass,RubyModule> refinements)
Copyright © 2001-2016 JRuby. All Rights Reserved.