Ruby
3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
|
Ruby 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. More... | |
Data Fields | |
VALUE | flags |
Per-object flags. More... | |
const VALUE | klass |
Class of an object. More... | |
Ruby object's base components.
All Ruby objects have them in common.
|
inline |
VALUE RBasic::flags |
Per-object flags.
Each Ruby object has its own characteristics apart from its class. 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 86 of file rbasic.h.
Referenced by rb_data_object_make().