|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyObject
org.jruby.RubyModule
Nested Class Summary |
Nested classes inherited from class org.jruby.RubyObject |
RubyObject.Finalizer |
Field Summary | |
SinglyLinkedList |
cref
|
static byte |
EQQ_SWITCHVALUE
|
int |
id
|
int |
index
|
Fields inherited from class org.jruby.RubyObject |
instanceVariables, isTrue, metaClass, NEVER, OBJECT_ALLOCATOR |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
NULL_ARRAY |
Constructor Summary | |
protected |
RubyModule(Ruby runtime,
RubyClass metaClass,
RubyClass superClass,
SinglyLinkedList parentCRef,
java.lang.String name)
|
Method Summary | |
void |
addClassProvider(ClassProvider provider)
|
void |
addMethod(java.lang.String name,
DynamicMethod method)
|
void |
addModuleFunction(java.lang.String name,
DynamicMethod method)
|
RubyModule |
alias_method(IRubyObject newId,
IRubyObject oldId)
|
RubyArray |
ancestors()
rb_mod_ancestors |
RubyModule |
append_features(IRubyObject module)
rb_mod_append_features |
IRubyObject |
attr_accessor(IRubyObject[] args)
rb_mod_attr_accessor |
IRubyObject |
attr_reader(IRubyObject[] args)
rb_mod_attr_reader |
IRubyObject |
attr_writer(IRubyObject[] args)
rb_mod_attr_writer |
IRubyObject |
attr(IRubyObject[] args)
rb_mod_attr |
IRubyObject |
callMethod(ThreadContext context,
RubyModule rubyclass,
int methodIndex,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
|
IRubyObject |
class_variable_get(IRubyObject var)
rb_mod_cvar_get |
IRubyObject |
class_variable_set(IRubyObject var,
IRubyObject value)
rb_mod_cvar_set |
RubyArray |
class_variables()
rb_mod_class_variables |
protected IRubyObject |
cloneMethods(RubyModule clone)
|
RubyBoolean |
const_defined(IRubyObject symbol)
rb_mod_const_defined |
IRubyObject |
const_get(IRubyObject symbol)
rb_mod_const_get |
IRubyObject |
const_missing(IRubyObject name,
Block block)
Base implementation of Module#const_missing, throws NameError for specific missing constant. |
IRubyObject |
const_set(IRubyObject symbol,
IRubyObject value)
rb_mod_const_set |
RubyArray |
constants()
rb_mod_constants |
static RubyClass |
createModuleClass(Ruby runtime,
RubyClass moduleClass)
|
IRubyObject |
define_method(IRubyObject[] args,
Block block)
|
void |
defineAlias(java.lang.String name,
java.lang.String oldName)
rb_alias |
RubyClass |
defineClassUnder(java.lang.String name,
RubyClass superClazz,
ObjectAllocator allocator)
rb_define_class_under |
void |
defineConstant(java.lang.String name,
IRubyObject value)
rb_define_const |
void |
defineFastMethod(java.lang.String name,
Callback method)
|
void |
defineFastMethod(java.lang.String name,
Callback method,
Visibility visibility)
|
void |
defineFastModuleFunction(java.lang.String name,
Callback method)
rb_define_module_function |
void |
defineFastPrivateMethod(java.lang.String name,
Callback method)
|
void |
defineFastProtectedMethod(java.lang.String name,
Callback method)
|
void |
defineFastPublicModuleFunction(java.lang.String name,
Callback method)
rb_define_module_function |
void |
defineMethod(java.lang.String name,
Callback method)
|
void |
defineModuleFunction(java.lang.String name,
Callback method)
rb_define_module_function |
RubyModule |
defineModuleUnder(java.lang.String name)
|
RubyClass |
defineOrGetClassUnder(java.lang.String name,
RubyClass superClazz)
|
void |
definePrivateMethod(java.lang.String name,
Callback method)
|
void |
definePublicModuleFunction(java.lang.String name,
Callback method)
rb_define_module_function |
protected IRubyObject |
doClone()
|
IRubyObject |
executeUnder(Callback method,
IRubyObject[] args,
Block block)
|
void |
exportMethod(java.lang.String name,
Visibility visibility)
rb_export_method |
IRubyObject |
extend_object(IRubyObject obj)
rb_mod_extend_object |
IRubyObject |
extended(IRubyObject other,
Block block)
|
RubyModule |
findImplementer(RubyModule clazz)
Search through this module and supermodules for method definitions. |
java.util.List |
getAncestorList()
|
java.lang.String |
getBaseName()
|
RubyClass |
getClass(java.lang.String name)
Finds a class that is within the current module (or class). |
IRubyObject |
getClassVar(java.lang.String name)
Retrieve the specified class variable, searching through this module, included modules, and supermodules. |
IRubyObject |
getConstant(java.lang.String name)
Retrieve the named constant, invoking 'const_missing' should that be appropriate. |
IRubyObject |
getConstantAt(java.lang.String name)
|
IRubyObject |
getConstantFrom(java.lang.String name)
|
SinglyLinkedList |
getCRef()
|
java.util.Map |
getMethods()
|
java.lang.String |
getName()
Generate a fully-qualified class name or a #-style name for anonymous and singleton classes. |
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are. |
RubyModule |
getNonIncludedClass()
|
RubyModule |
getParent()
|
RubyClass |
getSuperClass()
Getter for property superClass. |
RubyFixnum |
hash()
|
int |
hashCode()
|
boolean |
hasModuleInHierarchy(RubyModule type)
|
IRubyObject |
include_p(IRubyObject arg)
|
RubyModule |
include(IRubyObject[] modules)
rb_mod_include |
RubyArray |
included_modules()
rb_mod_included_modules |
IRubyObject |
included(IRubyObject other)
|
void |
includeModule(IRubyObject arg)
Include a new module in this module or class. |
IRubyObject |
initialize_copy(IRubyObject original)
rb_mod_init_copy |
IRubyObject |
initialize(IRubyObject[] args,
Block block)
rb_mod_initialize |
IRubyObject |
instance_method(IRubyObject symbol)
|
RubyArray |
instance_methods(IRubyObject[] args)
|
boolean |
isClass()
|
boolean |
isClassVarDefined(java.lang.String name)
Is class var defined? Ruby C equivalent = "rb_cvar_defined" |
boolean |
isIncluded()
Is this module one that in an included one (e.g. |
boolean |
isKindOfModule(RubyModule type)
|
boolean |
isMethodBound(java.lang.String name,
boolean checkVisibility)
MRI: rb_method_boundp |
boolean |
isModule()
|
boolean |
isSame(RubyModule module)
|
boolean |
isSingleton()
|
static void |
marshalTo(RubyModule module,
MarshalStream output)
|
IRubyObject |
method_added(IRubyObject nothing,
Block block)
|
RubyBoolean |
method_defined(IRubyObject symbol)
|
IRubyObject |
method_removed(IRubyObject nothing,
Block block)
|
IRubyObject |
method_undefined(IRubyObject nothing,
Block block)
|
IRubyObject |
module_eval(IRubyObject[] args,
Block block)
|
RubyModule |
module_function(IRubyObject[] args)
rb_mod_modfunc |
RubyString |
name()
|
static RubyArray |
nesting(IRubyObject recv,
Block block)
Return an array of nested modules or classes. |
IncludedModuleWrapper |
newIncludeClass(RubyClass superClazz)
Create a wrapper to use for including the specified module into this one. |
IRubyObject |
newMethod(IRubyObject receiver,
java.lang.String name,
boolean bound)
|
static RubyModule |
newModule(Ruby runtime,
RubyClass type,
java.lang.String name)
|
static RubyModule |
newModule(Ruby runtime,
RubyClass type,
java.lang.String name,
SinglyLinkedList parentCRef)
|
static RubyModule |
newModule(Ruby runtime,
java.lang.String name)
|
static RubyModule |
newModule(Ruby runtime,
java.lang.String name,
SinglyLinkedList parentCRef)
|
IRubyObject |
op_cmp(IRubyObject obj)
rb_mod_cmp |
RubyBoolean |
op_eqq(IRubyObject obj)
rb_mod_eqq |
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 |
private_class_method(IRubyObject[] args)
|
RubyArray |
private_instance_methods(IRubyObject[] args)
rb_class_private_instance_methods |
IRubyObject |
private_method_defined(IRubyObject symbol)
|
RubyArray |
protected_instance_methods(IRubyObject[] args)
rb_class_protected_instance_methods |
IRubyObject |
protected_method_defined(IRubyObject symbol)
|
RubyModule |
public_class_method(IRubyObject[] args)
|
RubyArray |
public_instance_methods(IRubyObject[] args)
|
IRubyObject |
public_method_defined(IRubyObject symbol)
|
void |
putMethod(java.lang.Object name,
DynamicMethod method)
|
RubyModule |
rbPrivate(IRubyObject[] args)
rb_mod_private |
RubyModule |
rbProtected(IRubyObject[] args)
rb_mod_protected |
RubyModule |
rbPublic(IRubyObject[] args)
rb_mod_public |
IRubyObject |
remove_class_variable(IRubyObject name)
rb_mod_remove_cvar |
IRubyObject |
remove_const(IRubyObject name)
|
RubyModule |
remove_method(IRubyObject[] args)
|
void |
removeCachedMethod(java.lang.String name)
|
void |
removeClassProvider(ClassProvider provider)
|
IRubyObject |
removeCvar(IRubyObject name)
rb_mod_remove_cvar |
void |
removeMethod(java.lang.String name)
|
DynamicMethod |
retrieveMethod(java.lang.String name)
Search through this module and supermodules for method definitions. |
DynamicMethod |
searchMethod(java.lang.String name)
Search through this module and supermodules for method definitions. |
void |
setBaseName(java.lang.String name)
|
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. |
void |
setMethodVisibility(IRubyObject[] methods,
Visibility visibility)
set_method_visibility |
void |
setParent(RubyModule p)
|
protected void |
setSuperClass(RubyClass superClass)
|
IRubyObject |
to_s()
rb_mod_to_s |
RubyModule |
undef_method(IRubyObject name)
|
void |
undef(java.lang.String name)
rb_undef |
void |
undefineMethod(java.lang.String name)
|
static RubyModule |
unmarshalFrom(UnmarshalStream input)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public int index
public final int id
public SinglyLinkedList cref
public static final byte EQQ_SWITCHVALUE
Constructor Detail |
protected RubyModule(Ruby runtime, RubyClass metaClass, RubyClass superClass, SinglyLinkedList parentCRef, java.lang.String name)
Method Detail |
public void addClassProvider(ClassProvider provider)
public void removeClassProvider(ClassProvider provider)
public static RubyClass createModuleClass(Ruby runtime, RubyClass moduleClass)
public int getNativeTypeIndex()
RubyObject
getNativeTypeIndex
in interface IRubyObject
getNativeTypeIndex
in class RubyObject
public IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
callMethod
in interface IRubyObject
callMethod
in class RubyObject
public RubyClass getSuperClass()
protected void setSuperClass(RubyClass superClass)
public RubyModule getParent()
public void setParent(RubyModule p)
public java.util.Map getMethods()
public void putMethod(java.lang.Object name, DynamicMethod method)
public boolean isModule()
public boolean isClass()
public boolean isSingleton()
isSingleton
in interface IRubyObject
isSingleton
in class RubyObject
public boolean isIncluded()
public RubyModule getNonIncludedClass()
public java.lang.String getBaseName()
public void setBaseName(java.lang.String name)
public java.lang.String getName()
public IncludedModuleWrapper newIncludeClass(RubyClass superClazz)
public IRubyObject setClassVar(java.lang.String name, IRubyObject value)
name
- The variable name to setvalue
- The value to set it topublic IRubyObject getClassVar(java.lang.String name)
name
- The name of the variable to retrieve
public boolean isClassVarDefined(java.lang.String name)
name
- The class var to determine "is defined?"
public 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 name
RubyObject.setInstanceVariable(String, IRubyObject, String, String)
public RubyClass getClass(java.lang.String name)
name
- to be found in this module (or class)
public IRubyObject const_missing(IRubyObject name, Block block)
name
- The constant name which was found to be missing
public void includeModule(IRubyObject arg)
arg
- The module to includepublic void defineMethod(java.lang.String name, Callback method)
public void defineFastMethod(java.lang.String name, Callback method)
public void defineFastMethod(java.lang.String name, Callback method, Visibility visibility)
public void definePrivateMethod(java.lang.String name, Callback method)
public void defineFastPrivateMethod(java.lang.String name, Callback method)
public void defineFastProtectedMethod(java.lang.String name, Callback method)
public void undefineMethod(java.lang.String name)
public void undef(java.lang.String name)
public IRubyObject include_p(IRubyObject arg)
public void addMethod(java.lang.String name, DynamicMethod method)
public void removeCachedMethod(java.lang.String name)
public void removeMethod(java.lang.String name)
public DynamicMethod searchMethod(java.lang.String name)
name
- The name of the method to search for
public DynamicMethod retrieveMethod(java.lang.String name)
name
- The name of the method to search for
public RubyModule findImplementer(RubyModule clazz)
public void addModuleFunction(java.lang.String name, DynamicMethod method)
public void defineModuleFunction(java.lang.String name, Callback method)
public void definePublicModuleFunction(java.lang.String name, Callback method)
public void defineFastModuleFunction(java.lang.String name, Callback method)
public void defineFastPublicModuleFunction(java.lang.String name, Callback method)
public IRubyObject getConstant(java.lang.String name)
name
- The constant to retrieve
public IRubyObject getConstantFrom(java.lang.String name)
public IRubyObject getConstantAt(java.lang.String name)
public void defineAlias(java.lang.String name, java.lang.String oldName)
public RubyClass defineOrGetClassUnder(java.lang.String name, RubyClass superClazz)
public RubyClass defineClassUnder(java.lang.String name, RubyClass superClazz, ObjectAllocator allocator)
public RubyModule defineModuleUnder(java.lang.String name)
public void defineConstant(java.lang.String name, IRubyObject value)
public IRubyObject removeCvar(IRubyObject name)
public void setMethodVisibility(IRubyObject[] methods, Visibility visibility)
public void exportMethod(java.lang.String name, Visibility visibility)
public boolean isMethodBound(java.lang.String name, boolean checkVisibility)
public IRubyObject newMethod(IRubyObject receiver, java.lang.String name, boolean bound)
public IRubyObject define_method(IRubyObject[] args, Block block)
public IRubyObject executeUnder(Callback method, IRubyObject[] args, Block block)
public static RubyModule newModule(Ruby runtime, java.lang.String name)
public static RubyModule newModule(Ruby runtime, RubyClass type, java.lang.String name)
public static RubyModule newModule(Ruby runtime, java.lang.String name, SinglyLinkedList parentCRef)
public static RubyModule newModule(Ruby runtime, RubyClass type, java.lang.String name, SinglyLinkedList parentCRef)
public RubyString name()
public RubyArray class_variables()
public IRubyObject class_variable_get(IRubyObject var)
public IRubyObject class_variable_set(IRubyObject var, IRubyObject value)
protected IRubyObject cloneMethods(RubyModule clone)
protected IRubyObject doClone()
doClone
in class RubyObject
public IRubyObject initialize_copy(IRubyObject original)
initialize_copy
in class RubyObject
public RubyArray included_modules()
public RubyArray ancestors()
public java.util.List getAncestorList()
public boolean hasModuleInHierarchy(RubyModule type)
public int hashCode()
hashCode
in class RubyObject
public RubyFixnum hash()
hash
in class RubyObject
public IRubyObject to_s()
to_s
in class RubyObject
public RubyBoolean op_eqq(IRubyObject obj)
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)
public boolean isSame(RubyModule module)
public IRubyObject initialize(IRubyObject[] args, Block block)
initialize
in class RubyObject
public IRubyObject attr(IRubyObject[] args)
public IRubyObject attr_reader(IRubyObject[] args)
public IRubyObject attr_writer(IRubyObject[] args)
public IRubyObject attr_accessor(IRubyObject[] args)
public IRubyObject const_get(IRubyObject symbol)
public IRubyObject const_set(IRubyObject symbol, IRubyObject value)
public RubyBoolean const_defined(IRubyObject symbol)
public RubyArray instance_methods(IRubyObject[] args)
public RubyArray public_instance_methods(IRubyObject[] args)
public IRubyObject instance_method(IRubyObject symbol)
public RubyArray protected_instance_methods(IRubyObject[] args)
public RubyArray private_instance_methods(IRubyObject[] args)
public RubyArray constants()
public IRubyObject remove_class_variable(IRubyObject name)
public IRubyObject remove_const(IRubyObject name)
public RubyModule append_features(IRubyObject module)
public IRubyObject extend_object(IRubyObject obj)
public RubyModule include(IRubyObject[] modules)
public IRubyObject included(IRubyObject other)
public IRubyObject extended(IRubyObject other, Block block)
public RubyModule rbPublic(IRubyObject[] args)
public RubyModule rbProtected(IRubyObject[] args)
public RubyModule rbPrivate(IRubyObject[] args)
public RubyModule module_function(IRubyObject[] args)
public IRubyObject method_added(IRubyObject nothing, Block block)
public IRubyObject method_removed(IRubyObject nothing, Block block)
public IRubyObject method_undefined(IRubyObject nothing, Block block)
public RubyBoolean method_defined(IRubyObject symbol)
public IRubyObject public_method_defined(IRubyObject symbol)
public IRubyObject protected_method_defined(IRubyObject symbol)
public IRubyObject private_method_defined(IRubyObject symbol)
public RubyModule public_class_method(IRubyObject[] args)
public RubyModule private_class_method(IRubyObject[] args)
public RubyModule alias_method(IRubyObject newId, IRubyObject oldId)
public RubyModule undef_method(IRubyObject name)
public IRubyObject module_eval(IRubyObject[] args, Block block)
public RubyModule remove_method(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 SinglyLinkedList getCRef()
public static RubyArray nesting(IRubyObject recv, Block block)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |