org.jruby
Class RubyModule

java.lang.Object
  extended byorg.jruby.RubyObject
      extended byorg.jruby.RubyModule
All Implemented Interfaces:
java.lang.Cloneable, IRubyObject
Direct Known Subclasses:
RubyClass

public class RubyModule
extends RubyObject

Author:
jpetersen

Field Summary
 RubyModule parentModule
           
 
Fields inherited from class org.jruby.RubyObject
runtime
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Constructor Summary
protected RubyModule(Ruby ruby, RubyClass rubyClass, RubyClass superClass, RubyModule parentModule, java.lang.String name)
           
 
Method Summary
 void addMethod(java.lang.String name, ICallable method)
          rb_add_method
 RubyModule alias_method(IRubyObject newId, IRubyObject oldId)
           
 void aliasMethod(java.lang.String name, java.lang.String oldName)
          rb_alias
 RubyArray ancestors()
          rb_mod_ancestors
 RubyModule append_features(RubyModule 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 symbol, IRubyObject[] args)
          rb_mod_attr
 IRubyObject call(IRubyObject recv, java.lang.String name, IRubyObject[] args, CallType callType)
          rb_call
 IRubyObject call0(IRubyObject recv, java.lang.String name, IRubyObject[] args, ICallable method, boolean noSuper)
          rb_call0
 RubyArray class_variables()
          rb_mod_class_variables
static void clearMethodCache(Ruby runtime)
           
static void clearMethodCache(Ruby runtime, java.lang.String methodName)
           
 RubyBoolean const_defined(IRubyObject symbol)
          rb_mod_const_defined
 IRubyObject const_get(IRubyObject symbol)
          rb_mod_const_get
 IRubyObject const_missing(IRubyObject name)
           
 IRubyObject const_set(IRubyObject symbol, IRubyObject value)
          rb_mod_const_set
 RubyArray constants()
          rb_mod_constants
static void createModuleClass(RubyClass moduleClass)
           
 IRubyObject define_method(IRubyObject[] args)
           
 void defineAlias(java.lang.String newName, java.lang.String oldName)
          rb_define_alias
 RubyClass defineClassUnder(java.lang.String name, RubyClass superClass)
          rb_define_class_under
 void defineConstant(java.lang.String name, IRubyObject value)
          rb_define_const
 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 superClass)
           
 void definePrivateMethod(java.lang.String name, Callback method)
           
 IRubyObject dup()
          rb_mod_dup
 IRubyObject executeUnder(Callback method, IRubyObject[] args)
           
 void exportMethod(java.lang.String name, Visibility visibility)
          rb_export_method
 IRubyObject extend_object(IRubyObject obj)
          rb_mod_extend_object
 java.lang.String getBaseName()
           
 java.lang.String getClassname()
           
 java.lang.String getClassPath()
           
 IRubyObject getClassVar(java.lang.String name)
          rb_cvar_get
 IRubyObject getConstant(java.lang.String name)
           
protected  CacheEntry getMethodBodyCached(java.lang.String name)
           
 java.util.Map getMethods()
           
 Visibility getMethodVisibility(java.lang.String name)
           
 java.lang.String getName()
          classname
 RubyClass getSuperClass()
          Getter for property superClass.
 RubyModule include(IRubyObject[] modules)
          rb_mod_include
 RubyArray included_modules()
          rb_mod_included_modules
 void includeModule(IRubyObject arg)
          Include a new module in this module or class.
 IRubyObject initialize(IRubyObject[] args)
          rb_mod_initialize
 IRubyObject instance_method(IRubyObject symbol)
           
 RubyArray instance_methods(IRubyObject[] args)
          rb_class_instance_methods
 boolean isClass()
           
 boolean isClassVarDefined(java.lang.String name)
          rb_cvar_defined
 boolean isConstantDefined(java.lang.String name)
          rb_const_defined
 boolean isConstantDefinedAt(java.lang.String name)
          MRI: rb_const_defined_at
 boolean isIncluded()
           
 boolean isMethodBound(java.lang.String name, boolean checkVisibility)
          MRI: rb_method_boundp
 boolean isMethodDefined(java.lang.String name)
           
 boolean isModule()
           
 boolean isSingleton()
           
 void marshalTo(MarshalStream output)
          Method marshalTo.
 RubyBoolean method_defined(IRubyObject symbol)
           
 IRubyObject module_eval(IRubyObject[] args)
           
 RubyModule module_function(IRubyObject[] args)
          rb_mod_modfunc
 RubyString name()
          rb_mod_name
static RubyArray nesting(IRubyObject recv)
          Return an array of nested modules or classes.
 IncludedModuleWrapper newIncludeClass(RubyClass superClass)
          include_class_new
 IRubyObject newMethod(IRubyObject receiver, java.lang.String name, boolean bound)
           
static RubyModule newModule(IRubyObject recv)
           
static RubyModule newModule(Ruby ruby, java.lang.String name)
           
static RubyModule newModule(Ruby ruby, java.lang.String name, RubyModule parentModule)
           
 RubyFixnum op_cmp(IRubyObject obj)
          rb_mod_cmp
 RubyBoolean op_eqq(IRubyObject obj)
          rb_mod_eqq
 RubyBoolean op_ge(IRubyObject obj)
          rb_mod_ge
 RubyBoolean op_gt(IRubyObject obj)
          rb_mod_gt
 RubyBoolean op_le(IRubyObject obj)
          rb_mod_le
 RubyBoolean op_lt(IRubyObject obj)
          rb_mod_lt
 RubyModule private_class_method(IRubyObject[] args)
           
 RubyArray private_instance_methods(IRubyObject[] args)
          rb_class_private_instance_methods
 RubyArray protected_instance_methods(IRubyObject[] args)
          rb_class_protected_instance_methods
 RubyModule public_class_method(IRubyObject[] args)
           
 IRubyObject rbClone()
          rb_mod_clone
 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 name)
           
 IRubyObject removeCvar(IRubyObject name)
          rb_mod_remove_cvar
 void removeMethod(java.lang.String name)
          remove_method
 ICallable searchMethod(java.lang.String name)
          search_method
 void setBaseName(java.lang.String name)
           
 void setClassVar(java.lang.String name, IRubyObject value)
          rb_cvar_set
 void setConstant(java.lang.String name, IRubyObject value)
           
 void setMethodVisibility(IRubyObject[] methods, Visibility visibility)
          set_method_visibility
protected  void testFrozen()
          rb_frozen_class_p
 RubyString to_s()
          rb_mod_to_s
 java.lang.String toName()
           
 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 org.jruby.RubyObject
argCount, asSymbol, callbackFactory, callInit, callMethod, callMethod, callMethod, checkSafeString, convertToString, convertToType, convertType, createObjectClass, defineSingletonMethod, display, equal, equals, eval, eval, evalUnder, extend, extendObject, freeze, frozen, getInstanceVariable, getInstanceVariables, getJavaClass, getMetaClass, getRuntime, getSingletonClass, getType, hash, hashCode, hasInstanceVariable, id, infectBy, inspect, instance_eval, instance_of, instance_variables, instanceVariableNames, isFalse, isFrozen, isKindOf, isNil, isTaint, isTrue, kind_of, makeMetaClass, method_missing, method, methods, nilObject, private_methods, protected_methods, removeInstanceVariable, respond_to, respondsTo, send, setFrozen, setInstanceVariable, setInstanceVariable, setInstanceVariables, setMetaClass, setTaint, setupClone, singleton_methods, singletonMethodsAllowed, specificEval, taint, tainted, to_a, toString, type, untaint
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

parentModule

public RubyModule parentModule
Constructor Detail

RubyModule

protected RubyModule(Ruby ruby,
                     RubyClass rubyClass,
                     RubyClass superClass,
                     RubyModule parentModule,
                     java.lang.String name)
Method Detail

getSuperClass

public RubyClass getSuperClass()
Getter for property superClass.

Returns:
Value of property superClass.

getMethods

public java.util.Map getMethods()

isModule

public boolean isModule()

isClass

public boolean isClass()

isSingleton

public boolean isSingleton()

isIncluded

public boolean isIncluded()

createModuleClass

public static void createModuleClass(RubyClass moduleClass)

getBaseName

public java.lang.String getBaseName()

setBaseName

public void setBaseName(java.lang.String name)

getName

public java.lang.String getName()
classname


getClassname

public java.lang.String getClassname()

toName

public java.lang.String toName()

getClassPath

public java.lang.String getClassPath()

newIncludeClass

public IncludedModuleWrapper newIncludeClass(RubyClass superClass)
include_class_new


setClassVar

public void setClassVar(java.lang.String name,
                        IRubyObject value)
rb_cvar_set


getClassVar

public IRubyObject getClassVar(java.lang.String name)
rb_cvar_get


isClassVarDefined

public boolean isClassVarDefined(java.lang.String name)
rb_cvar_defined


setConstant

public void setConstant(java.lang.String name,
                        IRubyObject value)

getConstant

public IRubyObject getConstant(java.lang.String name)

const_missing

public IRubyObject const_missing(IRubyObject name)

includeModule

public void includeModule(IRubyObject arg)
Include a new module in this module or class. MRI: rb_include_module Updated to Ruby 1.6.7.


addMethod

public void addMethod(java.lang.String name,
                      ICallable method)
rb_add_method


defineMethod

public void defineMethod(java.lang.String name,
                         Callback method)

definePrivateMethod

public void definePrivateMethod(java.lang.String name,
                                Callback method)

undefineMethod

public void undefineMethod(java.lang.String name)

testFrozen

protected void testFrozen()
rb_frozen_class_p


undef

public void undef(java.lang.String name)
rb_undef


defineModuleFunction

public void defineModuleFunction(java.lang.String name,
                                 Callback method)
rb_define_module_function


defineAlias

public void defineAlias(java.lang.String newName,
                        java.lang.String oldName)
rb_define_alias


isConstantDefined

public boolean isConstantDefined(java.lang.String name)
rb_const_defined


isConstantDefinedAt

public boolean isConstantDefinedAt(java.lang.String name)
MRI: rb_const_defined_at


searchMethod

public ICallable searchMethod(java.lang.String name)
search_method


getMethodVisibility

public Visibility getMethodVisibility(java.lang.String name)

getMethodBodyCached

protected CacheEntry getMethodBodyCached(java.lang.String name)

clearMethodCache

public static void clearMethodCache(Ruby runtime)

clearMethodCache

public static void clearMethodCache(Ruby runtime,
                                    java.lang.String methodName)

call

public final IRubyObject call(IRubyObject recv,
                              java.lang.String name,
                              IRubyObject[] args,
                              CallType callType)
rb_call


call0

public final IRubyObject call0(IRubyObject recv,
                               java.lang.String name,
                               IRubyObject[] args,
                               ICallable method,
                               boolean noSuper)
rb_call0


aliasMethod

public void aliasMethod(java.lang.String name,
                        java.lang.String oldName)
rb_alias


removeMethod

public void removeMethod(java.lang.String name)
remove_method


defineOrGetClassUnder

public RubyClass defineOrGetClassUnder(java.lang.String name,
                                       RubyClass superClass)

defineClassUnder

public RubyClass defineClassUnder(java.lang.String name,
                                  RubyClass superClass)
rb_define_class_under


defineModuleUnder

public RubyModule defineModuleUnder(java.lang.String name)

defineConstant

public void defineConstant(java.lang.String name,
                           IRubyObject value)
rb_define_const


removeCvar

public IRubyObject removeCvar(IRubyObject name)
rb_mod_remove_cvar


setMethodVisibility

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


exportMethod

public void exportMethod(java.lang.String name,
                         Visibility visibility)
rb_export_method


isMethodBound

public boolean isMethodBound(java.lang.String name,
                             boolean checkVisibility)
MRI: rb_method_boundp


isMethodDefined

public boolean isMethodDefined(java.lang.String name)

newMethod

public IRubyObject newMethod(IRubyObject receiver,
                             java.lang.String name,
                             boolean bound)

define_method

public IRubyObject define_method(IRubyObject[] args)

executeUnder

public IRubyObject executeUnder(Callback method,
                                IRubyObject[] args)

newModule

public static RubyModule newModule(Ruby ruby,
                                   java.lang.String name)

newModule

public static RubyModule newModule(Ruby ruby,
                                   java.lang.String name,
                                   RubyModule parentModule)

name

public RubyString name()
rb_mod_name


class_variables

public RubyArray class_variables()
rb_mod_class_variables


rbClone

public IRubyObject rbClone()
rb_mod_clone

Specified by:
rbClone in interface IRubyObject
Overrides:
rbClone in class RubyObject

dup

public IRubyObject dup()
rb_mod_dup

Specified by:
dup in interface IRubyObject
Overrides:
dup in class RubyObject

included_modules

public RubyArray included_modules()
rb_mod_included_modules


ancestors

public RubyArray ancestors()
rb_mod_ancestors


to_s

public RubyString to_s()
rb_mod_to_s

Overrides:
to_s in class RubyObject

op_eqq

public RubyBoolean op_eqq(IRubyObject obj)
rb_mod_eqq


op_le

public RubyBoolean op_le(IRubyObject obj)
rb_mod_le


op_lt

public RubyBoolean op_lt(IRubyObject obj)
rb_mod_lt


op_ge

public RubyBoolean op_ge(IRubyObject obj)
rb_mod_ge


op_gt

public RubyBoolean op_gt(IRubyObject obj)
rb_mod_gt


op_cmp

public RubyFixnum op_cmp(IRubyObject obj)
rb_mod_cmp


initialize

public IRubyObject initialize(IRubyObject[] args)
rb_mod_initialize


newModule

public static RubyModule newModule(IRubyObject recv)

nesting

public static RubyArray nesting(IRubyObject recv)
Return an array of nested modules or classes. rb_mod_nesting


attr

public IRubyObject attr(IRubyObject symbol,
                        IRubyObject[] args)
rb_mod_attr


attr_reader

public IRubyObject attr_reader(IRubyObject[] args)
rb_mod_attr_reader


attr_writer

public IRubyObject attr_writer(IRubyObject[] args)
rb_mod_attr_writer


attr_accessor

public IRubyObject attr_accessor(IRubyObject[] args)
rb_mod_attr_accessor


const_get

public IRubyObject const_get(IRubyObject symbol)
rb_mod_const_get


const_set

public IRubyObject const_set(IRubyObject symbol,
                             IRubyObject value)
rb_mod_const_set


const_defined

public RubyBoolean const_defined(IRubyObject symbol)
rb_mod_const_defined


instance_methods

public RubyArray instance_methods(IRubyObject[] args)
rb_class_instance_methods


instance_method

public IRubyObject instance_method(IRubyObject symbol)

protected_instance_methods

public RubyArray protected_instance_methods(IRubyObject[] args)
rb_class_protected_instance_methods


private_instance_methods

public RubyArray private_instance_methods(IRubyObject[] args)
rb_class_private_instance_methods


constants

public RubyArray constants()
rb_mod_constants


remove_class_variable

public IRubyObject remove_class_variable(IRubyObject name)
rb_mod_remove_cvar


remove_const

public IRubyObject remove_const(IRubyObject name)

append_features

public RubyModule append_features(RubyModule module)
rb_mod_append_features


extend_object

public IRubyObject extend_object(IRubyObject obj)
rb_mod_extend_object


include

public RubyModule include(IRubyObject[] modules)
rb_mod_include


rbPublic

public RubyModule rbPublic(IRubyObject[] args)
rb_mod_public


rbProtected

public RubyModule rbProtected(IRubyObject[] args)
rb_mod_protected


rbPrivate

public RubyModule rbPrivate(IRubyObject[] args)
rb_mod_private


module_function

public RubyModule module_function(IRubyObject[] args)
rb_mod_modfunc


method_defined

public RubyBoolean method_defined(IRubyObject symbol)

public_class_method

public RubyModule public_class_method(IRubyObject[] args)

private_class_method

public RubyModule private_class_method(IRubyObject[] args)

alias_method

public RubyModule alias_method(IRubyObject newId,
                               IRubyObject oldId)

undef_method

public RubyModule undef_method(IRubyObject name)

module_eval

public IRubyObject module_eval(IRubyObject[] args)

remove_method

public RubyModule remove_method(IRubyObject name)

marshalTo

public void marshalTo(MarshalStream output)
               throws java.io.IOException
Description copied from interface: IRubyObject
Method marshalTo.

Specified by:
marshalTo in interface IRubyObject
Overrides:
marshalTo in class RubyObject
Throws:
java.io.IOException

unmarshalFrom

public static RubyModule unmarshalFrom(UnmarshalStream input)
                                throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2002 Jan Arne Petersen. All Rights Reserved.