|
Ruby 4.1.0dev (2025-12-29 revision 9e78353c0f840bf4aa7cceb4d1676f4d090d0096)
|
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. | |
Data Fields | |
| VALUE | flags |
| Per-object flags. | |
| const VALUE | klass |
| Class of an object. | |
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 92 of file rbasic.h.
Referenced by rb_data_object_make(), and rb_data_typed_object_make().