diff options
author | Ufuk Kayserilioglu <[email protected]> | 2022-09-27 01:19:22 +0300 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2022-10-20 17:30:17 +0200 |
commit | 0378e2f4a8319440dd65c82b16f189161472d237 (patch) | |
tree | 6c2c6dd91c624fd4ae6ad4be5dd3a6d04528df37 /object.c | |
parent | 192bc725290ca4b271bff2bae6123d84c25f7173 (diff) |
Add Class#attached_object
Implements [Feature #12084]
Returns the object for which the receiver is the singleton class, or
raises TypeError if the receiver is not a singleton class.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6450
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -4464,6 +4464,7 @@ InitVM_Object(void) rb_define_method(rb_cClass, "initialize", rb_class_initialize, -1); rb_define_method(rb_cClass, "superclass", rb_class_superclass, 0); rb_define_method(rb_cClass, "subclasses", rb_class_subclasses, 0); /* in class.c */ + rb_define_method(rb_cClass, "attached_object", rb_class_attached_object, 0); /* in class.c */ rb_define_alloc_func(rb_cClass, rb_class_s_alloc); rb_undef_method(rb_cClass, "extend_object"); rb_undef_method(rb_cClass, "append_features"); |