summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorUfuk Kayserilioglu <ufuk@paralaus.com>2022-09-27 01:19:22 +0300
committerJean Boussier <jean.boussier@gmail.com>2022-10-20 17:30:17 +0200
commit0378e2f4a8319440dd65c82b16f189161472d237 (patch)
tree6c2c6dd91c624fd4ae6ad4be5dd3a6d04528df37 /object.c
parent192bc725290ca4b271bff2bae6123d84c25f7173 (diff)
downloadruby-0378e2f4a8319440dd65c82b16f189161472d237.tar.gz
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.
Diffstat (limited to 'object.c')
-rw-r--r--object.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/object.c b/object.c
index 0d99c6db47..fd07944d14 100644
--- a/object.c
+++ b/object.c
@@ -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");