Ruby 3.2.2p53 (2023-03-30 revision e51014f9c05aa65cbf203442d37fef7c12390015)
|
Ruby's object's, base components. More...
#include <rbasic.h>
Public Member Functions | |
RBasic () | |
We need to define this explicit constructor because the field klass is const-qualified above, which effectively defines the implicit default constructor as "deleted" (as of C++11) – No way but to define one by ourselves. | |
Data Fields | |
VALUE | flags |
Per-object flags. | |
const VALUE | klass |
Class of an object. | |
Ruby's object's, base components.
Every single ruby objects have them in common.
|
inline |
VALUE RBasic::flags |
Per-object flags.
Each ruby objects have their own characteristics apart from their classes. For instance whether an object is frozen or not is not controlled by its class. This is where such properties are stored.
_Alignas
in C. const VALUE RBasic::klass |
Class of an object.
Every object has its class. Also, everything is an object in Ruby. This means classes are also objects. Classes have their own classes, classes of classes have their classes, too ... and it recursively continues forever.
Also note the const
qualifier. In ruby an object cannot "change" its class.
Definition at line 88 of file rbasic.h.
Referenced by rb_data_object_alloc(), rb_data_object_make(), rb_data_typed_object_alloc(), and rb_data_typed_object_make().