| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static RubyClass | Returns: The new classthe current thread context context, String The name for the new class name, RubyClass The super class for the new class superClass, ObjectAllocator An ObjectAllocator instance that can construct
instances of the new class. allocator)Define a new class under the Object namespace. |
| public static RubyModule | Returns: The new module or existing one if it has already been defined.The name of the new module name)Define a new module under the Object namespace. |
| public static RubyModule | Returns: an instance of a RubyModulethe current thread context context)There are times when an anonymous module is needed. |
| Define | back to summary |
|---|---|
| public Define() | |
| defineClass | back to summary |
|---|---|
| public static RubyClass defineClass(ThreadContext context, String name, RubyClass superClass, ObjectAllocator allocator) Define a new class under the Object namespace. Roughly equivalent to
rb_define_class in MRI. This is a convenience method as you could use
Note If a class already exists for this name it returns it or errors if it is not a Class at all.
| |
| defineModule | back to summary |
|---|---|
| public static RubyModule defineModule(ThreadContext context, String name) Define a new module under the Object namespace. Roughly equivalent to rb_define_module in MRI. Note If a module already exists for this name it returns it or errors if it is not a Module at all.
| |
| defineModule | back to summary |
|---|---|
| public static RubyModule defineModule(ThreadContext context) There are times when an anonymous module is needed. It is up to the caller to set it up as a constant or include methods or whatever else is needed.
| |