org.jruby
Class RubyClasses

java.lang.Object
  extended byorg.jruby.RubyClasses

public class RubyClasses
extends java.lang.Object

In this class there are references to the core (or built-in) classes and modules of Ruby and JRuby. There is also a Map of referenced to the named classes in a Ruby runtime. The default classes are:

The default modules are: You can access the references by the get<classname>Class or get<modulename>Module methods.

Since:
0.1.8
Author:
jpetersen

Constructor Summary
RubyClasses(Ruby ruby)
          Creates a new RubyClasses instance and defines all the core classes and modules in the Ruby runtime.
 
Method Summary
 RubyClass getArrayClass()
          Returns the reference to the Array class.
 RubyClass getBignumClass()
          Returns the reference to the Bignum class.
 RubyClass getBindingClass()
          Returns the reference to the Binding class.
 RubyModule getClass(java.lang.String name)
          Gets the class attribute of the RubyClasses object
 RubyClass getClassClass()
          Returns the reference to the Class class.
 RubyModule getClassFromPath(java.lang.String path)
           
 java.util.Map getClassMap()
          Returns a RubyMap with references to all named classes in a ruby runtime..
 RubyModule getComparableModule()
          Returns the reference to the Comparable module.
 RubyClass getContinuationClass()
          Returns the reference to the Continuation class.
 RubyClass getDirClass()
          Returns the reference to the Dir class.
 RubyModule getEnumerableModule()
          Returns the reference to the Enumerable module.
 RubyClass getExceptionClass()
          Returns the reference to the Exception class.
 RubyClass getFalseClass()
          Returns the reference to the FalseClass class.
 RubyClass getFileClass()
          Returns the reference to the File class.
 RubyClass getFileStatClass()
           
 RubyModule getFileTestModule()
          Returns the reference to the Enumerable module.
 RubyClass getFixnumClass()
          Returns the reference to the Fixnum class.
 RubyClass getFloatClass()
          Returns the reference to the Float class.
 RubyModule getGcModule()
          Returns the reference to the GC module.
 RubyClass getHashClass()
          Returns the reference to the Hash class.
 RubyClass getIntegerClass()
          Returns the reference to the Integer class.
 RubyClass getIoClass()
          Returns the reference to the IO class.
 RubyClass getJavaArrayClass()
           
 RubyModule getJavaModule()
          Returns the reference to the Java module.
 RubyClass getJavaObjectClass()
          Returns the reference to the JavaObject class.
 RubyModule getKernelModule()
          Returns the reference to the Kernel module.
 RubyModule getMarshalModule()
          Returns the reference to the Marshal module.
 RubyClass getMatchDataClass()
          Returns the reference to the MatchData class.
 RubyModule getMathModule()
          Returns the reference to the Math module.
 RubyClass getMethodClass()
          Returns the reference to the Method class.
 RubyClass getModuleClass()
          Returns the reference to the Module class.
 RubyClass getNilClass()
          Returns the reference to the NilClass class.
 RubyClass getNumericClass()
          Returns the reference to the Numeric class.
 RubyClass getObjectClass()
          Returns the reference to the Object class.
 RubyModule getObjectSpaceModule()
          Returns the reference to the ObjectSpace module.
 RubyModule getPrecisionModule()
          Gets the precisionModule attribute of the RubyClasses object
 RubyClass getProcClass()
          Returns the reference to the Proc class.
 RubyModule getProcessModule()
          Gets the processModule attribute of the RubyClasses object
 RubyClass getRangeClass()
          Returns the reference to the Range class.
 RubyClass getRegExpClass()
          Returns the reference to the RegExp class.
 RubyClass getStringClass()
          Returns the reference to the String class.
 RubyClass getStructClass()
          Returns the reference to the Struct class.
 RubyClass getStructTmsClass()
          Returns the reference to the Struct::Tms class.
 RubyClass getSymbolClass()
          Returns the reference to the Symbol class.
 RubyClass getThreadClass()
          Returns the reference to the Thread class.
 RubyClass getThreadGroupClass()
          Returns the reference to the ThreadGroup class.
 RubyClass getTimeClass()
          Returns the reference to the Time class.
 RubyClass getTrueClass()
          Returns the reference to the TrueClass class.
 RubyClass getUnboundMethodClass()
           
 void initBuiltinClasses()
           
 void initCoreClasses()
          This method defines the core classes and modules in the Ruby runtime.
 java.util.Iterator nameIterator()
          Description of the Method
 void putClass(java.lang.String name, RubyModule rbClass)
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RubyClasses

public RubyClasses(Ruby ruby)
Creates a new RubyClasses instance and defines all the core classes and modules in the Ruby runtime.

Parameters:
ruby - The Ruby runtime.
Method Detail

initCoreClasses

public void initCoreClasses()
This method defines the core classes and modules in the Ruby runtime. Ruby's Class Hierarchy Chart

                           +------------------+
                           |                  |
             Object---->(Object)              |
              ^  ^        ^  ^                |
              |  |        |  |                |
              |  |  +-----+  +---------+      |
              |  |  |                  |      |
              |  +-----------+         |      |
              |     |        |         |      |
       +------+     |     Module--->(Module)  |
       |            |        ^         ^      |
  OtherClass-->(OtherClass)  |         |      |
                             |         |      |
                           Class---->(Class)  |
                             ^                |
                             |                |
                             +----------------+

 
+ All metaclasses are instances of the class `Class'.


initBuiltinClasses

public void initBuiltinClasses()

getBindingClass

public RubyClass getBindingClass()
Returns the reference to the Binding class.

Returns:
the Binding class.

getClassClass

public RubyClass getClassClass()
Returns the reference to the Class class.

Returns:
The Class class.

getModuleClass

public RubyClass getModuleClass()
Returns the reference to the Module class.

Returns:
The Module class.

getStructClass

public RubyClass getStructClass()
Returns the reference to the Struct class.

Returns:
The Struct class.

getComparableModule

public RubyModule getComparableModule()
Returns the reference to the Comparable module.

Returns:
The Comparable module.

getHashClass

public RubyClass getHashClass()
Returns the reference to the Hash class.

Returns:
The Hash class.

getMathModule

public RubyModule getMathModule()
Returns the reference to the Math module.

Returns:
The Math module.

getRegExpClass

public RubyClass getRegExpClass()
Returns the reference to the RegExp class.

Returns:
The RegExp class.

getIoClass

public RubyClass getIoClass()
Returns the reference to the IO class.

Returns:
The IO class.

getThreadGroupClass

public RubyClass getThreadGroupClass()
Returns the reference to the ThreadGroup class.

Returns:
The ThreadGroup class.

getBignumClass

public RubyClass getBignumClass()
Returns the reference to the Bignum class.

Returns:
The Bignum class.

getStructTmsClass

public RubyClass getStructTmsClass()
Returns the reference to the Struct::Tms class.

Returns:
The Struct::Tms class.

getRangeClass

public RubyClass getRangeClass()
Returns the reference to the Range class.

Returns:
The Range class.

getGcModule

public RubyModule getGcModule()
Returns the reference to the GC module.

Returns:
The GC module.

getSymbolClass

public RubyClass getSymbolClass()
Returns the reference to the Symbol class.

Returns:
The Symbol class.

getProcClass

public RubyClass getProcClass()
Returns the reference to the Proc class.

Returns:
The Proc class.

getContinuationClass

public RubyClass getContinuationClass()
Returns the reference to the Continuation class.

Returns:
The Continuation class.

getFalseClass

public RubyClass getFalseClass()
Returns the reference to the FalseClass class.

Returns:
The FalseClass class.

getFloatClass

public RubyClass getFloatClass()
Returns the reference to the Float class.

Returns:
The Float class.

getMethodClass

public RubyClass getMethodClass()
Returns the reference to the Method class.

Returns:
The Method class.

getMatchDataClass

public RubyClass getMatchDataClass()
Returns the reference to the MatchData class.

Returns:
The MatchData class.

getMarshalModule

public RubyModule getMarshalModule()
Returns the reference to the Marshal module.

Returns:
The Marshal module.

getFixnumClass

public RubyClass getFixnumClass()
Returns the reference to the Fixnum class.

Returns:
The Fixnum class.

getObjectClass

public RubyClass getObjectClass()
Returns the reference to the Object class.

Returns:
The Object class.

getObjectSpaceModule

public RubyModule getObjectSpaceModule()
Returns the reference to the ObjectSpace module.

Returns:
The ObjectSpace module.

getDirClass

public RubyClass getDirClass()
Returns the reference to the Dir class.

Returns:
The Dir class.

getExceptionClass

public RubyClass getExceptionClass()
Returns the reference to the Exception class.

Returns:
The Exception class.

getStringClass

public RubyClass getStringClass()
Returns the reference to the String class.

Returns:
The String class.

getTrueClass

public RubyClass getTrueClass()
Returns the reference to the TrueClass class.

Returns:
The TrueClass class.

getIntegerClass

public RubyClass getIntegerClass()
Returns the reference to the Integer class.

Returns:
The Integer class.

getKernelModule

public RubyModule getKernelModule()
Returns the reference to the Kernel module.

Returns:
The Kernel module.

getThreadClass

public RubyClass getThreadClass()
Returns the reference to the Thread class.

Returns:
The Thread class.

getFileClass

public RubyClass getFileClass()
Returns the reference to the File class.

Returns:
The File class.

getFileStatClass

public RubyClass getFileStatClass()

getNilClass

public RubyClass getNilClass()
Returns the reference to the NilClass class.

Returns:
The NilClass class.

getArrayClass

public RubyClass getArrayClass()
Returns the reference to the Array class.

Returns:
The Array class.

getEnumerableModule

public RubyModule getEnumerableModule()
Returns the reference to the Enumerable module.

Returns:
The Enumerable module.

getFileTestModule

public RubyModule getFileTestModule()
Returns the reference to the Enumerable module.

Returns:
The Enumerable module.

getPrecisionModule

public RubyModule getPrecisionModule()
Gets the precisionModule attribute of the RubyClasses object

Returns:
The precisionModule value

getProcessModule

public RubyModule getProcessModule()
Gets the processModule attribute of the RubyClasses object

Returns:
The processModule value

getJavaObjectClass

public RubyClass getJavaObjectClass()
Returns the reference to the JavaObject class.

Returns:
The JavaObject class.

getJavaArrayClass

public RubyClass getJavaArrayClass()

getJavaModule

public RubyModule getJavaModule()
Returns the reference to the Java module.

Returns:
The Java module.

getNumericClass

public RubyClass getNumericClass()
Returns the reference to the Numeric class.

Returns:
The Numeric class.

getTimeClass

public RubyClass getTimeClass()
Returns the reference to the Time class.

Returns:
The Time class.

getUnboundMethodClass

public RubyClass getUnboundMethodClass()

getClassMap

public java.util.Map getClassMap()
Returns a RubyMap with references to all named classes in a ruby runtime..

Returns:
A map with references to all named classes.

getClass

public RubyModule getClass(java.lang.String name)
Gets the class attribute of the RubyClasses object

Parameters:
name - Description of the Parameter
Returns:
The class value

getClassFromPath

public RubyModule getClassFromPath(java.lang.String path)

putClass

public void putClass(java.lang.String name,
                     RubyModule rbClass)
Description of the Method

Parameters:
name - Description of the Parameter
rbClass - Description of the Parameter

nameIterator

public java.util.Iterator nameIterator()
Description of the Method

Returns:
Description of the Return Value


Copyright © 2002 Jan Arne Petersen. All Rights Reserved.