diff options
author | Jean Boussier <[email protected]> | 2023-02-15 10:42:52 +0100 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2023-02-15 15:24:22 +0100 |
commit | 7413079dae81e46aefc948cd8872497567945791 (patch) | |
tree | 31c1118b1bd5d751940571505ff5db1058d612e4 /object.c | |
parent | bac4d2eefa079168968841079727fe2289b6ab6e (diff) |
Encapsulate RCLASS_ATTACHED_OBJECT
Right now the attached object is stored as an instance variable
and all the call sites that either get or set it have to know how it's
stored.
It's preferable to hide this implementation detail behind accessors
so that it is easier to change how it's stored.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7308
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1587,7 +1587,7 @@ rb_mod_to_s(VALUE klass) if (FL_TEST(klass, FL_SINGLETON)) { VALUE s = rb_usascii_str_new2("#<Class:"); - VALUE v = rb_ivar_get(klass, id__attached__); + VALUE v = RCLASS_ATTACHED_OBJECT(klass); if (CLASS_OR_MODULE_P(v)) { rb_str_append(s, rb_inspect(v)); |