Top Description Fields Constructors Methods
org.jruby

public Class IncludedModuleWrapper

extends IncludedModule
Class Inheritance
Known Direct Subclasses
org.jruby.javasupport.JavaPackage.BlankSlateWrapper
Imports
java.util.Collection, .List, .Map, .Set, org.jruby.internal.runtime.methods.DynamicMethod, org.jruby.runtime.ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject, .Variable

This class is used to provide an intermediate superclass for modules and classes that include other modules. It inserts itself as the immediate superClass of the includer, but defers all module methods to the actual superclass. Multiple of these intermediate superclasses can be added for multiple included modules. This allows the normal superclass-based searches (searchMethod, getConstant, etc) to traverse the superclass ancestors as normal while the included modules do not actually show up in direct inheritance traversal.
See Also
org.jruby.RubyModule

Field Summary

Inherited from org.jruby.IncludedModule:
origin

Constructor Summary

AccessConstructor and Description
public
IncludedModuleWrapper(Ruby
the runtime
runtime
,
RubyClass
the superclass
superClass
,
RubyModule
the actual module not a wrapper from a prepend or include.
origin
)

public
IncludedModuleWrapper(Ruby runtime, RubyClass superClass, RubyModule origin, RubyModule methodsHolder)

Method Summary

Modifier and TypeMethod and Description
protected RubyModule.ConstantEntry
protected IRubyObject
protected IRubyObject
protected IRubyObject
protected IRubyObject
protected Map<String, RubyModule.Autoload>
getAutoloadMap()

Overrides org.jruby.RubyModule.getAutoloadMap.

AutoloadMap must be accessed after checking ConstantMap.

protected Map<String, RubyModule.Autoload>
public RubyModule
public boolean
isIncluded()

Overrides org.jruby.RubyModule.isIncluded.

Is this module one that in an included one (e.g. an IncludedModuleWrapper).

public boolean
protected boolean
public IncludedModuleWrapper
newIncludeClass(RubyClass superClass)

Overrides org.jruby.RubyModule.newIncludeClass.

Deprecated

Overridden newIncludeClass implementation to allow attaching future includes to the correct module (i.e. the one to which this is attached)

protected boolean
variableTableContains(String
to lookup
name
)

Overrides org.jruby.RubyBasicObject.variableTableContains.

Checks if the variable table contains a variable of the specified name.

protected Object
variableTableFetch(String
to lookup
name
)

Overrides org.jruby.RubyBasicObject.variableTableFetch.

Fetch an object from the variable table based on the name.

protected Object
variableTableRemove(String
to remove
name
)

Overrides org.jruby.RubyBasicObject.variableTableRemove.

Removes the entry with the specified name from the variable table, and returning the removed value.

protected Object
variableTableStore(String
to store in
name
,
Object
to store
value
)

Overrides org.jruby.RubyBasicObject.variableTableStore.

Store a value in the variable store under the specific name.

protected void
variableTableSync(List<Variable<Object>>
to to sync with
vars
)

Overrides org.jruby.RubyBasicObject.variableTableSync.

Synchronize the variable table with the argument.

Inherited from org.jruby.IncludedModule:
getClassVariablesgetClassVariablesForReadgetNamegetNonIncludedClassgetOriginidisClassisImmediateisModulesetMetaClass

Constructor Detail

IncludedModuleWrapperback to summary
public IncludedModuleWrapper(Ruby runtime, RubyClass superClass, RubyModule origin)
Parameters
runtime:Ruby

the runtime

superClass:RubyClass

the superclass

origin:RubyModule

the actual module not a wrapper from a prepend or include.

IncludedModuleWrapperback to summary
public IncludedModuleWrapper(Ruby runtime, RubyClass superClass, RubyModule origin, RubyModule methodsHolder)

Method Detail

constantEntryFetchback to summary
protected RubyModule.ConstantEntry constantEntryFetch(String name)

Overrides org.jruby.RubyModule.constantEntryFetch.

Annotations
@Override
constantTableRemoveback to summary
protected IRubyObject constantTableRemove(String name)

Overrides org.jruby.RubyModule.constantTableRemove.

Annotations
@Override
constantTableStoreback to summary
protected IRubyObject constantTableStore(String name, IRubyObject value)

Overrides org.jruby.RubyModule.constantTableStore.

Annotations
@Override
constantTableStoreback to summary
protected IRubyObject constantTableStore(String name, IRubyObject value, boolean hidden)

Overrides org.jruby.RubyModule.constantTableStore.

getAutoloadConstantback to summary
protected IRubyObject getAutoloadConstant(ThreadContext context, String name, boolean forceLoad)

Overrides org.jruby.RubyModule.getAutoloadConstant.

Annotations
@Override
getAutoloadMapback to summary
protected Map<String, RubyModule.Autoload> getAutoloadMap()

Overrides org.jruby.RubyModule.getAutoloadMap.

Doc from org.jruby.RubyModule.getAutoloadMap.

AutoloadMap must be accessed after checking ConstantMap. Checking UNDEF value in constantMap works as a guard. For looking up constant, check constantMap first then try to get an Autoload object from autoloadMap. For setting constant, update constantMap first and remove an Autoload object from autoloadMap.

Annotations
@Override
getAutoloadMapForWriteback to summary
protected Map<String, RubyModule.Autoload> getAutoloadMapForWrite()

Overrides org.jruby.RubyModule.getAutoloadMapForWrite.

Annotations
@Override
getDelegateback to summary
public RubyModule getDelegate()

Overrides org.jruby.RubyModule.getDelegate.

Implements org.jruby.DelegatedModule.getDelegate.

isIncludedback to summary
public boolean isIncluded()

Overrides org.jruby.RubyModule.isIncluded.

Doc from org.jruby.RubyModule.isIncluded.

Is this module one that in an included one (e.g. an IncludedModuleWrapper).

Annotations
@Override
isPrependedback to summary
public boolean isPrepended()

Overrides org.jruby.RubyModule.isPrepended.

Annotations
@Override
isSameback to summary
protected boolean isSame(RubyModule module)

Overrides org.jruby.RubyModule.isSame.

Annotations
@Override
newIncludeClassback to summary
public IncludedModuleWrapper newIncludeClass(RubyClass superClass)

Overrides org.jruby.RubyModule.newIncludeClass.

Deprecated

Overridden newIncludeClass implementation to allow attaching future includes to the correct module (i.e. the one to which this is attached)

Returns:IncludedModuleWrapper

Doc from org.jruby.RubyModule.newIncludeClass.

The module wrapper

Annotations
@Override
@Deprecated
See Also
org.jruby.RubyModule#newIncludeClass(RubyClass)
variableTableContainsback to summary
protected boolean variableTableContains(String name)

Overrides org.jruby.RubyBasicObject.variableTableContains.

Doc from org.jruby.RubyBasicObject.variableTableContains.

Checks if the variable table contains a variable of the specified name.

Parameters
name:String

to lookup

Returns:boolean

if contained in this object

Annotations
@Override
variableTableFetchback to summary
protected Object variableTableFetch(String name)

Overrides org.jruby.RubyBasicObject.variableTableFetch.

Doc from org.jruby.RubyBasicObject.variableTableFetch.

Fetch an object from the variable table based on the name.

Parameters
name:String

to lookup

Returns:Object

the object or null if not found

Annotations
@Override
variableTableRemoveback to summary
protected Object variableTableRemove(String name)

Overrides org.jruby.RubyBasicObject.variableTableRemove.

Doc from org.jruby.RubyBasicObject.variableTableRemove.

Removes the entry with the specified name from the variable table, and returning the removed value.

Parameters
name:String

to remove

Returns:Object

the value removed

Annotations
@Override
variableTableStoreback to summary
protected Object variableTableStore(String name, Object value)

Overrides org.jruby.RubyBasicObject.variableTableStore.

Doc from org.jruby.RubyBasicObject.variableTableStore.

Store a value in the variable store under the specific name.

Parameters
name:String

to store in

value:Object

to store

Returns:Object

value

Annotations
@Override
variableTableSyncback to summary
protected void variableTableSync(List<Variable<Object>> vars)

Overrides org.jruby.RubyBasicObject.variableTableSync.

Doc from org.jruby.RubyBasicObject.variableTableSync.

Synchronize the variable table with the argument. In real terms this means copy all entries into a newly allocated table.

Parameters
vars:List<Variable<Object>>

to to sync with

Annotations
@Override