org.jruby
Class RubyClass

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

public class RubyClass
extends RubyModule

Author:
jpetersen

Field Summary
 
Fields inherited from class org.jruby.RubyModule
parentModule
 
Fields inherited from class org.jruby.RubyObject
runtime
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Constructor Summary
protected RubyClass(RubyClass superClass)
           
protected RubyClass(Ruby ruby, RubyClass superClass)
           
protected RubyClass(Ruby ruby, RubyClass rubyClass, RubyClass superClass)
           
protected RubyClass(Ruby ruby, RubyClass rubyClass, RubyClass superClass, RubyModule parentClass, java.lang.String name)
           
 
Method Summary
 IRubyObject allocateObject()
          Creates a new object of this class by calling the 'allocate' method.
 void attachToObject(IRubyObject object)
           
static void createClassClass(RubyClass classClass)
           
 RubyClass getMetaClass()
          if exist return the meta-class else return the type of the object.
 RubyClass getRealClass()
           
 RubyClass getSingletonClassClone()
          rb_singleton_class_clone
static IRubyObject inherited(RubyClass recv)
          rb_class_s_inherited
 void inheritedBy(RubyClass superType)
          Invokes if a class is inherited from an other class.
 boolean isClass()
           
 boolean isModule()
           
 boolean isSingleton()
           
 void marshalTo(MarshalStream output)
          Method marshalTo.
static RubyClass newClass(IRubyObject recv, IRubyObject[] args)
          rb_class_s_new
static RubyClass newClass(Ruby ruby, RubyClass superClass, RubyModule parentClass, java.lang.String name)
           
 IRubyObject newInstance(IRubyObject[] args)
          rb_class_new_instance
 MetaClass newSingletonClass()
           
protected  RubyClass subclass()
          Create a new subclass of this class.
 IRubyObject superclass()
          Return the real super class of this class.
protected  void testFrozen()
          rb_frozen_class_p
static RubyModule unmarshalFrom(UnmarshalStream output)
           
 
Methods inherited from class org.jruby.RubyModule
addMethod, alias_method, aliasMethod, ancestors, append_features, attr_accessor, attr_reader, attr_writer, attr, call, call0, class_variables, clearMethodCache, clearMethodCache, const_defined, const_get, const_missing, const_set, constants, createModuleClass, define_method, defineAlias, defineClassUnder, defineConstant, defineMethod, defineModuleFunction, defineModuleUnder, defineOrGetClassUnder, definePrivateMethod, dup, executeUnder, exportMethod, extend_object, getBaseName, getClassname, getClassPath, getClassVar, getConstant, getMethodBodyCached, getMethods, getMethodVisibility, getName, getSuperClass, include, included_modules, includeModule, initialize, instance_method, instance_methods, isClassVarDefined, isConstantDefined, isConstantDefinedAt, isIncluded, isMethodBound, isMethodDefined, method_defined, module_eval, module_function, name, nesting, newIncludeClass, newMethod, newModule, newModule, newModule, op_cmp, op_eqq, op_ge, op_gt, op_le, op_lt, private_class_method, private_instance_methods, protected_instance_methods, public_class_method, rbClone, rbPrivate, rbProtected, rbPublic, remove_class_variable, remove_const, remove_method, removeCvar, removeMethod, searchMethod, setBaseName, setClassVar, setConstant, setMethodVisibility, to_s, toName, undef_method, undef, undefineMethod
 
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, 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
 

Constructor Detail

RubyClass

protected RubyClass(RubyClass superClass)

RubyClass

protected RubyClass(Ruby ruby,
                    RubyClass superClass)

RubyClass

protected RubyClass(Ruby ruby,
                    RubyClass rubyClass,
                    RubyClass superClass)

RubyClass

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

testFrozen

protected void testFrozen()
Description copied from class: RubyModule
rb_frozen_class_p

Overrides:
testFrozen in class RubyModule

isModule

public boolean isModule()
Overrides:
isModule in class RubyModule

isClass

public boolean isClass()
Overrides:
isClass in class RubyModule

createClassClass

public static void createClassClass(RubyClass classClass)

inheritedBy

public void inheritedBy(RubyClass superType)
Invokes if a class is inherited from an other class. MRI: rb_class_inherited

Since:
Ruby 1.6.7

getSingletonClassClone

public RubyClass getSingletonClassClone()
rb_singleton_class_clone


isSingleton

public boolean isSingleton()
Overrides:
isSingleton in class RubyModule

getMetaClass

public RubyClass getMetaClass()
Description copied from class: RubyObject
if exist return the meta-class else return the type of the object.

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

getRealClass

public RubyClass getRealClass()

attachToObject

public void attachToObject(IRubyObject object)

newSingletonClass

public MetaClass newSingletonClass()

newClass

public static RubyClass newClass(Ruby ruby,
                                 RubyClass superClass,
                                 RubyModule parentClass,
                                 java.lang.String name)

subclass

protected RubyClass subclass()
Create a new subclass of this class.


newInstance

public IRubyObject newInstance(IRubyObject[] args)
rb_class_new_instance


newClass

public static RubyClass newClass(IRubyObject recv,
                                 IRubyObject[] args)
rb_class_s_new


superclass

public IRubyObject superclass()
Return the real super class of this class. rb_class_superclass


inherited

public static IRubyObject inherited(RubyClass recv)
rb_class_s_inherited


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 RubyModule
Throws:
java.io.IOException

unmarshalFrom

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

allocateObject

public IRubyObject allocateObject()
Creates a new object of this class by calling the 'allocate' method. This class must be the type of the new object.

Returns:
the new allocated object.


Copyright © 2002 Jan Arne Petersen. All Rights Reserved.