Ruby: Classes and their hierarchy.

Ruby 4.0.6p0 (2026-07-14 revision 03b6d3f8898a28604fe6cb00eae3226b821168f4)

Data Structures | Macros | Functions | Variables
Classes and their hierarchy.

## Data Structures
struct | rb_class_set_box_classext_args
struct | duplicate_id_tbl_data
struct | class_classext_foreach_arg
struct | clone_method_arg
struct | clone_const_arg
struct | cvc_table_copy_ctx
struct | subclass_traverse_data
struct | method_entry_arg

## Macros
#define | METACLASS_OF(k)
#define | SET_METACLASS_OF(k, cls)
#define | META_CLASS_OF_CLASS_CLASS_P(k)
| whether k is a meta^(n)-class of Class class
#define | HAVE_METACLASS_P(k)
| whether k has a metaclass
#define | ENSURE_EIGENCLASS(klass)
| ensures klass belongs to its own eigenclass.

## Functions
static void | rb_class_remove_from_super_subclasses (VALUE klass)
static void | rb_class_remove_from_module_subclasses (VALUE klass)
static void | rb_class_classext_free_subclasses (rb_classext_t *ext)
rb_classext_t * | rb_class_unlink_classext (VALUE klass, const rb_box_t *box)
void | rb_class_classext_free (VALUE klass, rb_classext_t *ext, bool is_prime)
void | rb_iclass_classext_free (VALUE klass, rb_classext_t *ext, bool is_prime)
static void | iclass_free_orphan_classext (VALUE klass, rb_classext_t *ext)
static int | set_box_classext_update (st_data_t *key_ptr, st_data_t *val_ptr, st_data_t a, int existing)
void | rb_class_set_box_classext (VALUE obj, const rb_box_t *box, rb_classext_t *ext)
static enum rb_id_table_iterator_result | duplicate_classext_m_tbl_i (ID key, VALUE value, void *data)
static struct rb_id_table * | duplicate_classext_m_tbl (struct rb_id_table *orig, VALUE klass, bool init_missing)
static rb_const_entry_t * | duplicate_classext_const_entry (rb_const_entry_t *src, VALUE klass)
static enum rb_id_table_iterator_result | duplicate_classext_const_tbl_i (ID key, VALUE value, void *data)
static struct rb_id_table * | duplicate_classext_const_tbl (struct rb_id_table *src, VALUE klass)
static void | class_duplicate_iclass_classext (VALUE iclass, rb_classext_t *mod_ext, const rb_box_t *box)
rb_classext_t * | rb_class_duplicate_classext (rb_classext_t *orig, VALUE klass, const rb_box_t *box)
void | rb_class_ensure_writable (VALUE klass)
static int | class_classext_foreach_i (st_data_t key, st_data_t value, st_data_t arg)
void | rb_class_classext_foreach (VALUE klass, rb_class_classext_foreach_callback_func *func, void *arg)
VALUE | rb_class_super_of (VALUE klass)
VALUE | rb_class_singleton_p (VALUE klass)
unsigned char | rb_class_variation_count (VALUE klass)
static rb_subclass_entry_t * | push_subclass_entry_to_list (VALUE super, VALUE klass)
void | rb_class_subclass_add (VALUE super, VALUE klass)
static void | rb_module_add_to_subclasses_list (VALUE module, VALUE iclass)
static void | rb_subclass_entry_remove (rb_subclass_entry_t *entry)
void | rb_class_foreach_subclass (VALUE klass, void(*f)(VALUE, VALUE), VALUE arg)
static void | class_detach_subclasses (VALUE klass, VALUE arg)
static void | class_switch_superclass (VALUE super, VALUE klass)
static VALUE | class_alloc0 (enum ruby_value_type type, VALUE klass, bool boxable)
| Allocates a struct RClass for a new class, iclass, or module.
static VALUE | class_alloc (enum ruby_value_type type, VALUE klass)
static VALUE | class_associate_super (VALUE klass, VALUE super, bool init)
VALUE | rb_class_set_super (VALUE klass, VALUE super)
static void | class_initialize_method_table (VALUE c)
static void | class_clear_method_table (VALUE c)
static VALUE | class_boot_boxable (VALUE super, bool boxable)
VALUE | rb_class_boot (VALUE super)
| A utility function that wraps class_alloc.
static VALUE * | class_superclasses_including_self (VALUE klass)
void | rb_class_update_superclasses (VALUE klass)
void | rb_check_inheritable (VALUE super)
| Asserts that the given class can derive a child class.
VALUE | rb_class_new (VALUE super)
| Creates a new, anonymous class.
VALUE | rb_class_s_alloc (VALUE klass)
static void | clone_method (VALUE old_klass, VALUE new_klass, ID mid, const rb_method_entry_t *me)
static enum rb_id_table_iterator_result | clone_method_i (ID key, VALUE value, void *data)
static int | clone_const (ID key, const rb_const_entry_t *ce, struct clone_const_arg *arg)
static enum rb_id_table_iterator_result | clone_const_i (ID key, VALUE value, void *data)
static void | class_init_copy_check (VALUE clone, VALUE orig)
static struct rb_cvar_class_tbl_entry * | cvc_table_entry_alloc (void)
static enum rb_id_table_iterator_result | cvc_table_copy (ID id, VALUE val, void *data)
static void | copy_tables (VALUE clone, VALUE orig)
static bool | ensure_origin (VALUE klass)
void | rb_class_set_initialized (VALUE klass)
void | rb_module_check_initializable (VALUE mod)
VALUE | rb_mod_init_copy (VALUE clone, VALUE orig)
| The comment that comes with this function says :nodoc:.
VALUE | rb_singleton_class_clone (VALUE obj)
| Clones a singleton class.
VALUE | rb_singleton_class_clone_and_attach (VALUE obj, VALUE attach)
void | rb_singleton_class_attached (VALUE klass, VALUE obj)
| Attaches a singleton class to its corresponding object.
static int | rb_singleton_class_has_metaclass_p (VALUE sklass)
int | rb_singleton_class_internal_p (VALUE sklass)
static VALUE | make_metaclass (VALUE klass)
| Creates a metaclass of klass.
static VALUE | make_singleton_class (VALUE obj)
| Creates a singleton class for obj.
static VALUE | boot_defclass (const char *name, VALUE super)
VALUE | rb_make_metaclass (VALUE obj, VALUE unused)
VALUE | rb_define_class_id (ID id, VALUE super)
| This is a very badly designed API that creates an anonymous class.
VALUE | rb_class_inherited (VALUE super, VALUE klass)
| Calls Class#inherited.
VALUE | rb_define_class (const char *name, VALUE super)
| Defines a top-level class.
VALUE | rb_define_class_under (VALUE outer, const char *name, VALUE super)
| Defines a class under the namespace of outer.
VALUE | rb_define_class_id_under_no_pin (VALUE outer, ID id, VALUE super)
VALUE | rb_define_class_id_under (VALUE outer, ID id, VALUE super)
| Identical to rb_define_class_under(), except it takes the name in ID instead of C's string.
VALUE | rb_module_s_alloc (VALUE klass)
static VALUE | module_new (VALUE klass)
VALUE | rb_module_new (void)
| Creates a new, anonymous module.
VALUE | rb_refinement_new (void)
| Creates a new, anonymous refinement.
VALUE | rb_define_module_id (ID id)
| This is a very badly designed API that creates an anonymous module.
VALUE | rb_define_module (const char *name)
| Defines a top-level module.
VALUE | rb_define_module_under (VALUE outer, const char *name)
| Defines a module under the namespace of outer.
VALUE | rb_define_module_id_under (VALUE outer, ID id)
| Identical to rb_define_module_under(), except it takes the name in ID instead of C's string.
VALUE | rb_include_class_new (VALUE module, VALUE super)
static int | include_modules_at (const VALUE klass, VALUE c, VALUE module, int search_super)
static void | ensure_includable (VALUE klass, VALUE module)
void | rb_include_module (VALUE klass, VALUE module)
| Includes a module to a class.
static enum rb_id_table_iterator_result | add_refined_method_entry_i (ID key, VALUE value, void *data)
static enum rb_id_table_iterator_result | clear_module_cache_i (ID id, VALUE val, void *data)
static bool | module_in_super_chain (const VALUE klass, VALUE module)
static enum rb_id_table_iterator_result | clear_constant_cache_i (ID id, VALUE value, void *data)
static int | do_include_modules_at (const VALUE klass, VALUE c, VALUE module, int search_super, bool check_cyclic)
static enum rb_id_table_iterator_result | move_refined_method (ID key, VALUE value, void *data)
static enum rb_id_table_iterator_result | cache_clear_refined_method (ID key, VALUE value, void *data)
void | rb_prepend_module (VALUE klass, VALUE module)
| Identical to rb_include_module(), except it "prepends" the passed module to the klass, instead of includes.
VALUE | rb_mod_included_modules (VALUE mod)
| Queries the list of included modules.
VALUE | rb_mod_include_p (VALUE mod, VALUE mod2)
| Queries if the passed module is included by the module.
VALUE | rb_mod_ancestors (VALUE mod)
| Queries the module's ancestors.
static void | class_descendants_recursive (VALUE klass, VALUE v)
static VALUE | class_descendants (VALUE klass, bool immediate_only)
VALUE | rb_class_subclasses (VALUE klass)
| Queries the class's direct descendants.
VALUE | rb_class_attached_object (VALUE klass)
| Returns the attached object for a singleton class.
static void | ins_methods_push (st_data_t name, st_data_t ary)
static int | ins_methods_i (st_data_t name, st_data_t type, st_data_t ary)
static int | ins_methods_type_i (st_data_t name, st_data_t type, st_data_t ary, rb_method_visibility_t visi)
static int | ins_methods_prot_i (st_data_t name, st_data_t type, st_data_t ary)
static int | ins_methods_priv_i (st_data_t name, st_data_t type, st_data_t ary)
static int | ins_methods_pub_i (st_data_t name, st_data_t type, st_data_t ary)
static int | ins_methods_undef_i (st_data_t name, st_data_t type, st_data_t ary)
static enum rb_id_table_iterator_result | method_entry_i (ID key, VALUE value, void *data)
static void | add_instance_method_list (VALUE mod, struct method_entry_arg *me_arg)
static bool | particular_class_p (VALUE mod)
static VALUE | class_instance_method_list (int argc, const VALUE *argv, VALUE mod, int obj, int(*func)(st_data_t, st_data_t, st_data_t))
VALUE | rb_class_instance_methods (int argc, const VALUE *argv, VALUE mod)
| Generates an array of symbols, which are the list of method names defined in the passed class.
VALUE | rb_class_protected_instance_methods (int argc, const VALUE *argv, VALUE mod)
| Identical to rb_class_instance_methods(), except it returns names of methods that are protected only.
VALUE | rb_class_private_instance_methods (int argc, const VALUE *argv, VALUE mod)
| Identical to rb_class_instance_methods(), except it returns names of methods that are private only.
VALUE | rb_class_public_instance_methods (int argc, const VALUE *argv, VALUE mod)
| Identical to rb_class_instance_methods(), except it returns names of methods that are public only.
VALUE | rb_class_undefined_instance_methods (VALUE mod)
VALUE | rb_obj_methods (int argc, const VALUE *argv, VALUE obj)
VALUE | rb_obj_protected_methods (int argc, const VALUE *argv, VALUE obj)
VALUE | rb_obj_private_methods (int argc, const VALUE *argv, VALUE obj)
VALUE | rb_obj_public_methods (int argc, const VALUE *argv, VALUE obj)
VALUE | rb_obj_singleton_methods (int argc, const VALUE *argv, VALUE obj)
| Identical to rb_class_instance_methods(), except it returns names of singleton methods instead of instance methods.
static VALUE | special_singleton_class_of (VALUE obj)
VALUE | rb_special_singleton_class (VALUE obj)
static VALUE | singleton_class_of (VALUE obj, bool ensure_eigenclass)
void | rb_freeze_singleton_class (VALUE x)
| This is an implementation detail of RB_OBJ_FREEZE().
VALUE | rb_singleton_class_get (VALUE obj)
| Returns the singleton class of obj, or nil if obj is not a singleton object.
VALUE | rb_singleton_class (VALUE obj)
| Finds or creates the singleton class of the passed object.
void | rb_class_modify_check (VALUE klass)
| Asserts that klass is not a frozen class.
void | rb_extend_object (VALUE obj, VALUE mod)
| Extend the object with the module.

## Variables
rb_serial_t | ruby_vm_global_cvar_state

## Detailed Description

Terminology
  - class: same as in Ruby.
  - singleton class: class for a particular object.
  - eigenclass: = singleton class
  - metaclass: class of a class. Metaclass is a kind of singleton class.
  - metametaclass: class of a metaclass.
  - meta^(n)-class: class of a meta^(n-1)-class.
  - attached object: A singleton class knows its unique instance. The instance is called the attached object for the singleton class.

## Macro Definition Documentation

## ◆ ENSURE_EIGENCLASS

#define ENSURE_EIGENCLASS | ( |  | klass | ) |

Value:
(HAVE_METACLASS_P(klass) ? METACLASS_OF(klass) : make_metaclass(klass))
HAVE_METACLASS_P
#define HAVE_METACLASS_P(k)
whether k has a metaclass
Definition class.c:1236
make_metaclass
static VALUE make_metaclass(VALUE klass)
Creates a metaclass of klass.
Definition class.c:1261

ensures klass belongs to its own eigenclass.

Returns
  the eigenclass of klass

Postcondition
  klass belongs to the returned eigenclass. i.e. the attached object of the eigenclass is klass.

Note
  this macro creates a new eigenclass if necessary.

Definition at line 1247 of file class.c.

Referenced by Init_class_hierarchy(), and make_metaclass().

## ◆ HAVE_METACLASS_P

#define HAVE_METACLASS_P | ( |  | k | ) |

Value:
(FL_TEST(METACLASS_OF(k), FL_SINGLETON) && \
rb_singleton_class_has_metaclass_p(k))
FL_SINGLETON
#define FL_SINGLETON
Old name of RUBY_FL_SINGLETON.
Definition fl_type.h:58
FL_TEST
#define FL_TEST
Old name of RB_FL_TEST.
Definition fl_type.h:130

whether k has a metaclass

Return values

  1 | if k has a metaclass
  0 | otherwise

Definition at line 1236 of file class.c.

## ◆ META_CLASS_OF_CLASS_CLASS_P

#define META_CLASS_OF_CLASS_CLASS_P | ( |  | k | ) |

Value:
(METACLASS_OF(k) == (k))

whether k is a meta^(n)-class of Class class

Return values

  1 | if k is a meta^(n)-class of Class class (n >= 0)
  0 | otherwise

Definition at line 1216 of file class.c.

Referenced by make_metaclass().

## ◆ METACLASS_OF

#define METACLASS_OF | ( |  | k | ) |

Value:
RBASIC(k)->klass
RBASIC
#define RBASIC(obj)
Convenient casting macro.
Definition rbasic.h:40

Definition at line 80 of file class.c.

## ◆ SET_METACLASS_OF

#define SET_METACLASS_OF | ( |  | k,
|  |  | cls )

Value:
RBASIC_SET_CLASS(k, cls)

Definition at line 81 of file class.c.

## Function Documentation

## ◆ add_instance_method_list()

void add_instance_method_list | ( | VALUE | mod,
|  | struct method_entry_arg * | me_arg )
| static

Definition at line 2297 of file class.c.

## ◆ add_refined_method_entry_i()

enum rb_id_table_iterator_result add_refined_method_entry_i | ( | ID | key,
|  | VALUE | value,
|  | void * | data )
| static

Definition at line 1723 of file class.c.

## ◆ boot_defclass()

VALUE boot_defclass | ( | const char * | name,
|  | VALUE | super )
| static

Definition at line 1314 of file class.c.

## ◆ cache_clear_refined_method()

enum rb_id_table_iterator_result cache_clear_refined_method | ( | ID | key,
|  | VALUE | value,
|  | void * | data )
| static

Definition at line 1896 of file class.c.

## ◆ class_alloc()

VALUE class_alloc | ( | enum ruby_value_type | type,
|  | VALUE | klass )
| static

Definition at line 697 of file class.c.

## ◆ class_alloc0()

VALUE class_alloc0 | ( | enum ruby_value_type | type,
|  | VALUE | klass,
|  | bool | boxable )
| static

Allocates a struct RClass for a new class, iclass, or module.

Parameters

  type | The type of the RClass (T_CLASS, T_ICLASS, or T_MODULE)
  klass | value for basic.klass of the returned object.

Returns
  an uninitialized Class/IClass/Module object.

Precondition
  klass must refer to a class or module

Note
  this function is not Class#allocate.

Definition at line 649 of file class.c.

## ◆ class_associate_super()

VALUE class_associate_super | ( | VALUE | klass,
|  | VALUE | super,
|  | bool | init )
| static

Definition at line 704 of file class.c.

## ◆ class_boot_boxable()

VALUE class_boot_boxable | ( | VALUE | super,
|  | bool | boxable )
| static

Definition at line 744 of file class.c.

## ◆ class_classext_foreach_i()

int class_classext_foreach_i | ( | st_data_t | key,
|  | st_data_t | value,
|  | st_data_t | arg )
| static

Definition at line 442 of file class.c.

## ◆ class_clear_method_table()

void class_clear_method_table | ( | VALUE | c | ) |
| static

Definition at line 738 of file class.c.

## ◆ class_descendants()

VALUE class_descendants | ( | VALUE | klass,
|  | bool | immediate_only )
| static

Definition at line 2116 of file class.c.

## ◆ class_descendants_recursive()

void class_descendants_recursive | ( | VALUE | klass,
|  | VALUE | v )
| static

Definition at line 2098 of file class.c.

## ◆ class_detach_subclasses()

void class_detach_subclasses | ( | VALUE | klass,
|  | VALUE | arg )
| static

Definition at line 624 of file class.c.

## ◆ class_duplicate_iclass_classext()

void class_duplicate_iclass_classext | ( | VALUE | iclass,
|  | rb_classext_t * | mod_ext,
|  | const rb_box_t * | box )
| static

Definition at line 284 of file class.c.

## ◆ class_init_copy_check()

void class_init_copy_check | ( | VALUE | clone,
|  | VALUE | orig )
| static

Definition at line 922 of file class.c.

## ◆ class_initialize_method_table()

void class_initialize_method_table | ( | VALUE | c | ) |
| static

Definition at line 731 of file class.c.

## ◆ class_instance_method_list()

VALUE class_instance_method_list | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | mod,
|  | int | obj,
|  | int(* | func )(st_data_t, st_data_t, st_data_t) )
| static

Definition at line 2314 of file class.c.

## ◆ class_superclasses_including_self()

VALUE * class_superclasses_including_self | ( | VALUE | klass | ) |
| static

Definition at line 776 of file class.c.

## ◆ class_switch_superclass()

void class_switch_superclass | ( | VALUE | super,
|  | VALUE | klass )
| static

Definition at line 630 of file class.c.

## ◆ clear_constant_cache_i()

enum rb_id_table_iterator_result clear_constant_cache_i | ( | ID | id,
|  | VALUE | value,
|  | void * | data )
| static

Definition at line 1754 of file class.c.

## ◆ clear_module_cache_i()

enum rb_id_table_iterator_result clear_module_cache_i | ( | ID | id,
|  | VALUE | val,
|  | void * | data )
| static

Definition at line 1730 of file class.c.

## ◆ clone_const()

int clone_const | ( | ID | key,
|  | const rb_const_entry_t * | ce,
|  | struct clone_const_arg * | arg )
| static

Definition at line 904 of file class.c.

## ◆ clone_const_i()

enum rb_id_table_iterator_result clone_const_i | ( | ID | key,
|  | VALUE | value,
|  | void * | data )
| static

Definition at line 916 of file class.c.

## ◆ clone_method()

void clone_method | ( | VALUE | old_klass,
|  | VALUE | new_klass,
|  | ID | mid,
|  | const rb_method_entry_t * | me )
| static

Definition at line 874 of file class.c.

## ◆ clone_method_i()

enum rb_id_table_iterator_result clone_method_i | ( | ID | key,
|  | VALUE | value,
|  | void * | data )
| static

Definition at line 891 of file class.c.

## ◆ copy_tables()

void copy_tables | ( | VALUE | clone,
|  | VALUE | orig )
| static

Definition at line 965 of file class.c.

## ◆ cvc_table_copy()

enum rb_id_table_iterator_result cvc_table_copy | ( | ID | id,
|  | VALUE | val,
|  | void * | data )
| static

Definition at line 947 of file class.c.

## ◆ cvc_table_entry_alloc()

struct rb_cvar_class_tbl_entry * cvc_table_entry_alloc | ( | void |  | ) |
| static

Definition at line 941 of file class.c.

## ◆ do_include_modules_at()

int do_include_modules_at | ( | const VALUE | klass,
|  | VALUE | c,
|  | VALUE | module,
|  | int | search_super,
|  | bool | check_cyclic )
| static

Definition at line 1761 of file class.c.

## ◆ duplicate_classext_const_entry()

rb_const_entry_t * duplicate_classext_const_entry | ( | rb_const_entry_t * | src,
|  | VALUE | klass )
| static

Definition at line 240 of file class.c.

## ◆ duplicate_classext_const_tbl()

struct rb_id_table * duplicate_classext_const_tbl | ( | struct rb_id_table * | src,
|  | VALUE | klass )
| static

Definition at line 265 of file class.c.

## ◆ duplicate_classext_const_tbl_i()

enum rb_id_table_iterator_result duplicate_classext_const_tbl_i | ( | ID | key,
|  | VALUE | value,
|  | void * | data )
| static

Definition at line 254 of file class.c.

## ◆ duplicate_classext_m_tbl()

struct rb_id_table * duplicate_classext_m_tbl | ( | struct rb_id_table * | orig,
|  | VALUE | klass,
|  | bool | init_missing )
| static

Definition at line 221 of file class.c.

## ◆ duplicate_classext_m_tbl_i()

enum rb_id_table_iterator_result duplicate_classext_m_tbl_i | ( | ID | key,
|  | VALUE | value,
|  | void * | data )
| static

Definition at line 212 of file class.c.

## ◆ ensure_includable()

void ensure_includable | ( | VALUE | klass,
|  | VALUE | module )
| static

Definition at line 1673 of file class.c.

## ◆ ensure_origin()

bool ensure_origin | ( | VALUE | klass | ) |
| static

Definition at line 1911 of file class.c.

## ◆ iclass_free_orphan_classext()

void iclass_free_orphan_classext | ( | VALUE | klass,
|  | rb_classext_t * | ext )
| static

Definition at line 146 of file class.c.

## ◆ include_modules_at()

int include_modules_at | ( | const VALUE | klass,
|  | VALUE | c,
|  | VALUE | module,
|  | int | search_super )
| static

Definition at line 1863 of file class.c.

## ◆ ins_methods_i()

int ins_methods_i | ( | st_data_t | name,
|  | st_data_t | type,
|  | st_data_t | ary )
| static

Definition at line 2219 of file class.c.

## ◆ ins_methods_priv_i()

int ins_methods_priv_i | ( | st_data_t | name,
|  | st_data_t | type,
|  | st_data_t | ary )
| static

Definition at line 2248 of file class.c.

## ◆ ins_methods_prot_i()

int ins_methods_prot_i | ( | st_data_t | name,
|  | st_data_t | type,
|  | st_data_t | ary )
| static

Definition at line 2242 of file class.c.

## ◆ ins_methods_pub_i()

int ins_methods_pub_i | ( | st_data_t | name,
|  | st_data_t | type,
|  | st_data_t | ary )
| static

Definition at line 2254 of file class.c.

## ◆ ins_methods_push()

void ins_methods_push | ( | st_data_t | name,
|  | st_data_t | ary )
| static

Definition at line 2213 of file class.c.

## ◆ ins_methods_type_i()

int ins_methods_type_i | ( | st_data_t | name,
|  | st_data_t | type,
|  | st_data_t | ary,
|  | rb_method_visibility_t | visi )
| static

Definition at line 2233 of file class.c.

## ◆ ins_methods_undef_i()

int ins_methods_undef_i | ( | st_data_t | name,
|  | st_data_t | type,
|  | st_data_t | ary )
| static

Definition at line 2260 of file class.c.

## ◆ make_metaclass()

VALUE make_metaclass | ( | VALUE | klass | ) |
| inlinestatic

Creates a metaclass of klass.

Parameters

  klass | a class

Returns
  created metaclass for the class

Precondition
  klass is a Class object
  klass has no singleton class.

Postcondition
  the class of klass is the returned class.
  the returned class is meta^(n+1)-class when klass is a meta^(n)-klass for n >= 0

Definition at line 1261 of file class.c.

## ◆ make_singleton_class()

VALUE make_singleton_class | ( | VALUE | obj | ) |
| inlinestatic

Creates a singleton class for obj.

Precondition
  obj must not be an immediate nor a special const.
  obj must not be a Class object.
  obj has no singleton class.

Definition at line 1297 of file class.c.

## ◆ method_entry_i()

enum rb_id_table_iterator_result method_entry_i | ( | ID | key,
|  | VALUE | value,
|  | void * | data )
| static

Definition at line 2271 of file class.c.

## ◆ module_in_super_chain()

bool module_in_super_chain | ( | const VALUE | klass,
|  | VALUE | module )
| static

Definition at line 1738 of file class.c.

## ◆ module_new()

VALUE module_new | ( | VALUE | klass | ) |
| inlinestatic

Definition at line 1563 of file class.c.

## ◆ move_refined_method()

enum rb_id_table_iterator_result move_refined_method | ( | ID | key,
|  | VALUE | value,
|  | void * | data )
| static

Definition at line 1869 of file class.c.

## ◆ particular_class_p()

bool particular_class_p | ( | VALUE | mod | ) |
| static

Definition at line 2305 of file class.c.

## ◆ push_subclass_entry_to_list()

rb_subclass_entry_t * push_subclass_entry_to_list | ( | VALUE | super,
|  | VALUE | klass )
| static

Definition at line 482 of file class.c.

## ◆ rb_check_inheritable()

void rb_check_inheritable | ( | VALUE | super | ) |

Asserts that the given class can derive a child class.

A class might or might not be able to do so; for instance a singleton class cannot.

Parameters

  [in] | super | Possible super class.

Exceptions

  rb_eTypeError | No it cannot.

Postcondition
  Upon successful return super can derive.

Definition at line 837 of file class.c.

Referenced by rb_class_new().

## ◆ rb_class_attached_object()

VALUE rb_class_attached_object | ( | VALUE | klass | ) |

Returns the attached object for a singleton class.

If the given class is not a singleton class, raises a TypeError.

Parameters

  [in] | klass | A class.

Returns
  The object which has the singleton class klass.

Definition at line 2203 of file class.c.

Referenced by rb_class_descendants().

## ◆ rb_class_boot()

VALUE rb_class_boot | ( | VALUE | super | ) |

A utility function that wraps class_alloc.

allocates a class and initializes safely.

Parameters

  super | a class from which the new class derives.

Returns
  a class object.

Precondition
  super must be a class.

Postcondition
  the metaclass of the new class is Class.

Definition at line 770 of file class.c.

Referenced by rb_class_new().

## ◆ rb_class_classext_foreach()

void rb_class_classext_foreach | ( | VALUE | klass,
|  | rb_class_classext_foreach_callback_func * | func,
|  | void * | arg )

Definition at line 451 of file class.c.

## ◆ rb_class_classext_free()

void rb_class_classext_free | ( | VALUE | klass,
|  | rb_classext_t * | ext,
|  | bool | is_prime )

Definition at line 98 of file class.c.

## ◆ rb_class_classext_free_subclasses()

void rb_class_classext_free_subclasses | ( | rb_classext_t * | ext | ) |
| static

Definition at line 575 of file class.c.

## ◆ rb_class_duplicate_classext()

rb_classext_t * rb_class_duplicate_classext | ( | rb_classext_t * | orig,
|  | VALUE | klass,
|  | const rb_box_t * | box )

Definition at line 335 of file class.c.

## ◆ rb_class_ensure_writable()

void rb_class_ensure_writable | ( | VALUE | klass | ) |

Definition at line 430 of file class.c.

## ◆ rb_class_foreach_subclass()

void rb_class_foreach_subclass | ( | VALUE | klass,
|  | void(* | f )(VALUE, VALUE),
|  | VALUE | arg )

Definition at line 607 of file class.c.

## ◆ rb_class_inherited()

VALUE rb_class_inherited | ( | VALUE | super,
|  | VALUE | klass )

Calls Class#inherited.

Parameters

  super | A class which will be called #inherited. NULL means Object class.
  klass | A Class object which derived from super

Returns
  the value Class#inherited returns

Precondition
  Each of super and klass must be a Class object.

Definition at line 1468 of file class.c.

Referenced by rb_define_class().

## ◆ rb_class_instance_methods()

VALUE rb_class_instance_methods | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | mod )

Generates an array of symbols, which are the list of method names defined in the passed class.

Parameters

  [in] | argc | Number of objects of argv.
  [in] | argv | Array of at most one object, which controls (if any) whether the return array includes the names of methods defined in ancestors or not.
  [in] | mod | A module or a class.

Exceptions

  rb_eArgError | `argc` out of range.

Returns
  An array of symbols collecting names of instance methods that are not private, defined at mod.

Definition at line 2385 of file class.c.

Referenced by rb_class_descendants().

## ◆ rb_class_modify_check()

void rb_class_modify_check | ( | VALUE | klass | ) |

Asserts that klass is not a frozen class.

Parameters

  [in] | klass | a Module object

Exceptions

  RuntimeError | if `klass` is not a class or frozen.

Definition at line 432 of file eval.c.

Referenced by rb_alias(), rb_deprecate_constant(), and rb_undef().

## ◆ rb_class_new()

VALUE rb_class_new | ( | VALUE | super | ) |

Creates a new, anonymous class.

Parameters

  [in] | super | What would become a parent class.

Exceptions

  rb_eTypeError | `super` is not something inheritable.

Returns
  An anonymous class that inherits super.

Definition at line 852 of file class.c.

Referenced by rb_define_class_id().

## ◆ rb_class_private_instance_methods()

VALUE rb_class_private_instance_methods | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | mod )

Identical to rb_class_instance_methods(), except it returns names of methods that are private only.

Parameters

  [in] | argc | Number of objects of argv.
  [in] | argv | Array of at most one object, which controls (if any) whether the return array includes the names of methods defined in ancestors or not.
  [in] | mod | A module or a class.

Exceptions

  rb_eArgError | `argc` out of range.

Returns
  An array of symbols collecting names of instance methods that are protected, defined at mod.

Definition at line 2423 of file class.c.

Referenced by rb_class_descendants().

## ◆ rb_class_protected_instance_methods()

VALUE rb_class_protected_instance_methods | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | mod )

Identical to rb_class_instance_methods(), except it returns names of methods that are protected only.

Parameters

  [in] | argc | Number of objects of argv.
  [in] | argv | Array of at most one object, which controls (if any) whether the return array includes the names of methods defined in ancestors or not.
  [in] | mod | A module or a class.

Exceptions

  rb_eArgError | `argc` out of range.

Returns
  An array of symbols collecting names of instance methods that are protected, defined at mod.

Definition at line 2400 of file class.c.

Referenced by rb_class_descendants().

## ◆ rb_class_public_instance_methods()

VALUE rb_class_public_instance_methods | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | mod )

Identical to rb_class_instance_methods(), except it returns names of methods that are public only.

Parameters

  [in] | argc | Number of objects of argv.
  [in] | argv | Array of at most one object, which controls (if any) whether the return array includes the names of methods defined in ancestors or not.
  [in] | mod | A module or a class.

Exceptions

  rb_eArgError | `argc` out of range.

Returns
  An array of symbols collecting names of instance methods that are public, defined at mod.

Definition at line 2438 of file class.c.

Referenced by rb_class_descendants().

## ◆ rb_class_remove_from_module_subclasses()

void rb_class_remove_from_module_subclasses | ( | VALUE | klass | ) |
| static

Definition at line 564 of file class.c.

## ◆ rb_class_remove_from_super_subclasses()

void rb_class_remove_from_super_subclasses | ( | VALUE | klass | ) |
| static

Definition at line 553 of file class.c.

## ◆ rb_class_s_alloc()

VALUE rb_class_s_alloc | ( | VALUE | klass | ) |

Definition at line 868 of file class.c.

## ◆ rb_class_set_box_classext()

void rb_class_set_box_classext | ( | VALUE | obj,
|  | const rb_box_t * | box,
|  | rb_classext_t * | ext )

Definition at line 185 of file class.c.

## ◆ rb_class_set_initialized()

void rb_class_set_initialized | ( | VALUE | klass | ) |

Definition at line 1001 of file class.c.

## ◆ rb_class_set_super()

VALUE rb_class_set_super | ( | VALUE | klass,
|  | VALUE | super )

Definition at line 725 of file class.c.

## ◆ rb_class_singleton_p()

VALUE rb_class_singleton_p | ( | VALUE | klass | ) |

Definition at line 470 of file class.c.

## ◆ rb_class_subclass_add()

void rb_class_subclass_add | ( | VALUE | super,
|  | VALUE | klass )

Definition at line 514 of file class.c.

## ◆ rb_class_subclasses()

VALUE rb_class_subclasses | ( | VALUE | klass | ) |

Queries the class's direct descendants.

This routine gathers classes that are direct subclasses of the given class, returning an array of classes that have the given class as a superclass. The returned array does not include singleton classes.

Parameters

  [in] | klass | A class.

Returns
  An array of classes where klass is the superclass.

Definition at line 2180 of file class.c.

Referenced by rb_class_descendants().

## ◆ rb_class_super_of()

VALUE rb_class_super_of | ( | VALUE | klass | ) |

Definition at line 464 of file class.c.

## ◆ rb_class_undefined_instance_methods()

VALUE rb_class_undefined_instance_methods | ( | VALUE | mod | ) |

Definition at line 2452 of file class.c.

## ◆ rb_class_unlink_classext()

rb_classext_t * rb_class_unlink_classext | ( | VALUE | klass,
|  | const rb_box_t * | box )

Definition at line 88 of file class.c.

## ◆ rb_class_update_superclasses()

void rb_class_update_superclasses | ( | VALUE | klass | ) |

Definition at line 791 of file class.c.

## ◆ rb_class_variation_count()

unsigned char rb_class_variation_count | ( | VALUE | klass | ) |

Definition at line 476 of file class.c.

## ◆ rb_define_class()

VALUE rb_define_class | ( | const char * | name,
|  | VALUE | super )

Defines a top-level class.

Parameters

  [in] | name | Name of the class.
  [in] | super | A class from which the new class will derive.

Exceptions

  rb_eTypeError | The constant name `name` is already taken but the constant is not a class.
  rb_eTypeError | The class is already defined but the class can not be reopened because its superclass is not super.
  rb_eArgError | `super` is NULL.

Returns
  The created class.

Postcondition
  Top-level constant named name refers the returned class.

Note
  If a class named name is already defined and its superclass is super, the function just returns the defined class.
  The GC does not collect nor move classes returned by this function. They are immortal.

Definition at line 1477 of file class.c.

## ◆ rb_define_class_id()

VALUE rb_define_class_id | ( | ID | id,
|  | VALUE | super )

This is a very badly designed API that creates an anonymous class.

Parameters

  [in] | id | Discarded for no reason (why...).
  [in] | super | What would become a parent class. 0 means rb_cObject.

Exceptions

  rb_eTypeError | `super` is not something inheritable.

Returns
  An anonymous class that inherits super.

Warning
  You must explicitly name the return value.

Definition at line 1447 of file class.c.

Referenced by rb_define_class().

## ◆ rb_define_class_id_under()

VALUE rb_define_class_id_under | ( | VALUE | outer,
|  | ID | id,
|  | VALUE | super )

Identical to rb_define_class_under(), except it takes the name in ID instead of C's string.

Parameters

  [out] | outer | A class which contains the new class.
  [in] | id | Name of the new class
  [in] | super | A class from which the new class will derive. 0 means rb_cObject.

Exceptions

  rb_eTypeError | The constant name `id` is already taken but the constant is not a class.
  rb_eTypeError | The class is already defined but the class can not be reopened because its superclass is not super.
  rb_eArgError | `super` is NULL.

Returns
  The created class.

Postcondition
  outer::id refers the returned class.

Note
  If a class named id is already defined and its superclass is super, the function just returns the defined class.
  The GC does not collect nor move classes returned by this function. They are immortal.

Definition at line 1547 of file class.c.

Referenced by rb_define_class_under(), and rb_struct_define_under().

## ◆ rb_define_class_id_under_no_pin()

VALUE rb_define_class_id_under_no_pin | ( | VALUE | outer,
|  | ID | id,
|  | VALUE | super )

Definition at line 1514 of file class.c.

## ◆ rb_define_class_under()

VALUE rb_define_class_under | ( | VALUE | outer,
|  | const char * | name,
|  | VALUE | super )

Defines a class under the namespace of outer.

Parameters

  [out] | outer | A class which contains the new class.
  [in] | name | Name of the new class
  [in] | super | A class from which the new class will derive. 0 means rb_cObject.

Exceptions

  rb_eTypeError | The constant name `name` is already taken but the constant is not a class.
  rb_eTypeError | The class is already defined but the class can not be reopened because its superclass is not super.
  rb_eArgError | `super` is NULL.

Returns
  The created class.

Postcondition
  outer::name refers the returned class.

Note
  If a class named name is already defined and its superclass is super, the function just returns the defined class.
  The GC does not collect nor move classes returned by this function. They are immortal.

Definition at line 1508 of file class.c.

## ◆ rb_define_module()

VALUE rb_define_module | ( | const char * | name | ) |

Defines a top-level module.

Parameters

  [in] | name | Name of the module.

Exceptions

  rb_eTypeError | The constant name `name` is already taken but the constant is not a module.

Returns
  The created module.

Postcondition
  Top-level constant named name refers the returned module.

Note
  The GC does not collect nor move modules returned by this function. They are immortal.

Definition at line 1590 of file class.c.

## ◆ rb_define_module_id()

VALUE rb_define_module_id | ( | ID | id | ) |

This is a very badly designed API that creates an anonymous module.

Parameters

  [in] | id | Discarded for no reason (why...).

Returns
  An anonymous module.

Warning
  You must explicitly name the return value.

Definition at line 1584 of file class.c.

## ◆ rb_define_module_id_under()

VALUE rb_define_module_id_under | ( | VALUE | outer,
|  | ID | id )

Identical to rb_define_module_under(), except it takes the name in ID instead of C's string.

Parameters

  [out] | outer | A class which contains the new module.
  [in] | id | Name of the new module

Exceptions

  rb_eTypeError | The constant name `id` is already taken but the constant is not a module.

Returns
  The created module.

Postcondition
  outer::id refers the returned module.

Note
  The GC does not collect nor move classes returned by this function. They are immortal.

Definition at line 1619 of file class.c.

Referenced by rb_define_module_under().

## ◆ rb_define_module_under()

VALUE rb_define_module_under | ( | VALUE | outer,
|  | const char * | name )

Defines a module under the namespace of outer.

Parameters

  [out] | outer | A class which contains the new module.
  [in] | name | Name of the new module

Exceptions

  rb_eTypeError | The constant name `name` is already taken but the constant is not a class.

Returns
  The created module.

Postcondition
  outer::name refers the returned module.

Note
  The GC does not collect nor move modules returned by this function. They are immortal.

Definition at line 1613 of file class.c.

## ◆ rb_extend_object()

void rb_extend_object | ( | VALUE | obj,
|  | VALUE | mod )

Extend the object with the module.

Warning
  This is the same as Module#extend_object, not Object#extend! These two methods are very similar, but not identical. The difference is the hook. Module#extend_object does not invoke Module#extended, while Object#extend does.

Parameters

  [out] | obj | Object to extend.
  [in] | mod | Module of extension.

Definition at line 1871 of file eval.c.

Referenced by rb_eval_string_wrap().

## ◆ rb_freeze_singleton_class()

void rb_freeze_singleton_class | ( | VALUE | klass | ) |

This is an implementation detail of RB_OBJ_FREEZE().

People don't use it directly.

Parameters

  [out] | klass | A singleton class.

Postcondition
  klass gets frozen.

Definition at line 2764 of file class.c.

Referenced by rb_obj_freeze_inline().

## ◆ rb_iclass_classext_free()

void rb_iclass_classext_free | ( | VALUE | klass,
|  | rb_classext_t * | ext,
|  | bool | is_prime )

Definition at line 124 of file class.c.

## ◆ rb_include_class_new()

VALUE rb_include_class_new | ( | VALUE | module,
|  | VALUE | super )

Definition at line 1643 of file class.c.

## ◆ rb_include_module()

void rb_include_module | ( | VALUE | klass,
|  | VALUE | module )

Includes a module to a class.

Parameters

  [out] | klass | Inclusion destination.
  [in] | module | Inclusion source.

Exceptions

  rb_eArgError | Cyclic inclusion.

Definition at line 1684 of file class.c.

Referenced by rb_extend_object().

## ◆ rb_make_metaclass()

VALUE rb_make_metaclass | ( | VALUE | obj,
|  | VALUE | unused )

Definition at line 1436 of file class.c.

## ◆ rb_mod_ancestors()

VALUE rb_mod_ancestors | ( | VALUE | mod | ) |

Queries the module's ancestors.

This routine gathers classes and modules that the passed module either inherits, includes, or prepends, then recursively applies that routine again and again to the collected entries until the list doesn't grow up.

Parameters

  [in] | mod | A module or a class.

Returns
  An array of classes or modules that mod possibly recursively inherits, includes, or prepends.

Definition at line 2068 of file class.c.

## ◆ rb_mod_include_p()

VALUE rb_mod_include_p | ( | VALUE | child,
|  | VALUE | parent )

Queries if the passed module is included by the module.

It can also be seen as a routine to first call rb_mod_included_modules(), then see if the return value contains the passed module.

Parameters

  [in] | child | A Module.
  [in] | parent | Another Module.

Exceptions

  rb_eTypeError | `child` is not an instance of rb_cModule.

Return values

  RUBY_Qtrue | parent is either included or prepended in any of child's ancestry tree (including itself).

Returns
  RUBY_Qfalse Otherwise.

Definition at line 2036 of file class.c.

## ◆ rb_mod_included_modules()

VALUE rb_mod_included_modules | ( | VALUE | mod | ) |

Queries the list of included modules.

It can also be seen as a routine to first call rb_mod_ancestors(), then rejects non-modules from the return value.

Parameters

  [in] | mod | Class or Module.

Returns
  An array of modules that are either included or prepended in any of mod's ancestry tree (including itself).

Definition at line 2000 of file class.c.

## ◆ rb_mod_init_copy()

VALUE rb_mod_init_copy | ( | VALUE | clone,
|  | VALUE | orig )

The comment that comes with this function says :nodoc:.

Not sure what that means though.

Parameters

  [out] | clone | Destination object.
  [in] | orig | Source object.

Exceptions

  rb_eTypeError | Cannot copy `orig`.

Returns
  The passed clone.

Definition at line 1018 of file class.c.

## ◆ rb_module_add_to_subclasses_list()

void rb_module_add_to_subclasses_list | ( | VALUE | module,
|  | VALUE | iclass )
| static

Definition at line 525 of file class.c.

## ◆ rb_module_check_initializable()

void rb_module_check_initializable | ( | VALUE | mod | ) |

Definition at line 1009 of file class.c.

## ◆ rb_module_new()

VALUE rb_module_new | ( | void |  | ) |

Creates a new, anonymous module.

Returns
  An anonymous module.

Definition at line 1571 of file class.c.

Referenced by rb_define_module_id(), and rb_eval_string_wrap().

## ◆ rb_module_s_alloc()

VALUE rb_module_s_alloc | ( | VALUE | klass | ) |

Definition at line 1555 of file class.c.

## ◆ rb_obj_methods()

VALUE rb_obj_methods | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | obj )

Definition at line 2489 of file class.c.

## ◆ rb_obj_private_methods()

VALUE rb_obj_private_methods | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | obj )

Definition at line 2523 of file class.c.

## ◆ rb_obj_protected_methods()

VALUE rb_obj_protected_methods | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | obj )

Definition at line 2508 of file class.c.

## ◆ rb_obj_public_methods()

VALUE rb_obj_public_methods | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | obj )

Definition at line 2538 of file class.c.

## ◆ rb_obj_singleton_methods()

VALUE rb_obj_singleton_methods | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | obj )

Identical to rb_class_instance_methods(), except it returns names of singleton methods instead of instance methods.

Parameters

  [in] | argc | Number of objects of argv.
  [in] | argv | Array of at most one object, which controls (if any) whether the return array includes the names of methods defined in ancestors or not.
  [in] | obj | Arbitrary ruby object.

Exceptions

  rb_eArgError | `argc` out of range.

Returns
  An array of symbols collecting names of instance methods that are not private, defined at the singleton class of obj.

Definition at line 2577 of file class.c.

Referenced by rb_class_descendants().

## ◆ rb_prepend_module()

void rb_prepend_module | ( | VALUE | klass,
|  | VALUE | module )

Identical to rb_include_module(), except it "prepends" the passed module to the klass, instead of includes.

This affects how super resolves. For instance:

class Q; def foo; "<q/>" end end
module W; def foo; "<w>#{super}</w>" end end
class E < Q; include W; def foo; "<e>#{super}</e>" end end
class R < Q; prepend W; def foo; "<r>#{super}</r>" end end
E.new.foo # => "<e><w><q/></w></e>"
r.new.foo # => "<W><r><q/></r></w>"

Parameters

  [out] | klass | Target class to modify.
  [in] | module | Module to prepend.

Exceptions

  rb_eArgError | Cyclic inclusion.

Definition at line 1934 of file class.c.

## ◆ rb_refinement_new()

VALUE rb_refinement_new | ( | void |  | ) |

Creates a new, anonymous refinement.

Returns
  An anonymous refinement.

Definition at line 1577 of file class.c.

## ◆ rb_singleton_class()

VALUE rb_singleton_class | ( | VALUE | obj | ) |

Finds or creates the singleton class of the passed object.

Parameters

  [out] | obj | Arbitrary ruby object.

Exceptions

  rb_eTypeError | `obj` cannot have its singleton class.

Returns
  A (possibly newly allocated) instance of rb_cClass.

Postcondition
  obj has its singleton class, which is the return value.
  In case obj is a class, the returned singleton class also has its own singleton class in order to keep consistency of the inheritance structure of metaclasses.

Note
  A new singleton class will be created if obj did not have one.
  The singleton classes for RUBY_Qnil, RUBY_Qtrue, and RUBY_Qfalse are rb_cNilClass, rb_cTrueClass, and rb_cFalseClass respectively.

Definition at line 2799 of file class.c.

Referenced by rb_class_descendants(), rb_extend_object(), and rb_obj_singleton_methods().

## ◆ rb_singleton_class_attached()

void rb_singleton_class_attached | ( | VALUE | klass,
|  | VALUE | obj )

Attaches a singleton class to its corresponding object.

This is basically an implementation detail of rb_clone_setup(). People need not be aware of this working behind-the-scene.

Parameters

  [in] | klass | The singleton class.
  [out] | obj | The object to attach a class.

Precondition
  The passed two objects must agree with each other that klass becomes a singleton class of obj.

Postcondition
  klass becomes the singleton class of obj.

Definition at line 1204 of file class.c.

Referenced by make_metaclass(), make_singleton_class(), and rb_mod_init_copy().

## ◆ rb_singleton_class_clone()

VALUE rb_singleton_class_clone | ( | VALUE | obj | ) |

Clones a singleton class.

An object can have its own singleton class. OK. Then what happens when a program clones such object? The singleton class that is attached to the source object must also be cloned. Otherwise a singleton object gets shared with two objects, which breaks "singleton"-ness of such class.

This is basically an implementation detail of rb_clone_setup(). People need not be aware of this working behind-the-scene.

Parameters

  [in] | obj | The object that has its own singleton class.

Returns
  Cloned singleton class.

Definition at line 1135 of file class.c.

Referenced by rb_mod_init_copy().

## ◆ rb_singleton_class_clone_and_attach()

VALUE rb_singleton_class_clone_and_attach | ( | VALUE | obj,
|  | VALUE | attach )

Definition at line 1142 of file class.c.

## ◆ rb_singleton_class_get()

VALUE rb_singleton_class_get | ( | VALUE | obj | ) |

Returns the singleton class of obj, or nil if obj is not a singleton object.

Parameters

  obj | an arbitrary object.

Returns
  the singleton class or nil.

Definition at line 2785 of file class.c.

## ◆ rb_singleton_class_has_metaclass_p()

int rb_singleton_class_has_metaclass_p | ( | VALUE | sklass | ) |
| static

Definition at line 1219 of file class.c.

## ◆ rb_singleton_class_internal_p()

int rb_singleton_class_internal_p | ( | VALUE | sklass | ) |

Definition at line 1225 of file class.c.

## ◆ rb_special_singleton_class()

VALUE rb_special_singleton_class | ( | VALUE | obj | ) |

Definition at line 2696 of file class.c.

## ◆ rb_subclass_entry_remove()

void rb_subclass_entry_remove | ( | rb_subclass_entry_t * | entry | ) |
| static

Definition at line 536 of file class.c.

## ◆ set_box_classext_update()

int set_box_classext_update | ( | st_data_t * | key_ptr,
|  | st_data_t * | val_ptr,
|  | st_data_t | a,
|  | int | existing )
| static

Definition at line 166 of file class.c.

## ◆ singleton_class_of()

VALUE singleton_class_of | ( | VALUE | obj,
|  | bool | ensure_eigenclass )
| static

Definition at line 2711 of file class.c.

## ◆ special_singleton_class_of()

VALUE special_singleton_class_of | ( | VALUE | obj | ) |
| inlinestatic

Definition at line 2685 of file class.c.

## Variable Documentation

## ◆ ruby_vm_global_cvar_state

rb_serial_t ruby_vm_global_cvar_state
| extern

Definition at line 728 of file vm.c.