From 0378e2f4a8319440dd65c82b16f189161472d237 Mon Sep 17 00:00:00 2001 From: Ufuk Kayserilioglu Date: Tue, 27 Sep 2022 01:19:22 +0300 Subject: 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. --- object.c | 1 + 1 file changed, 1 insertion(+) (limited to 'object.c') 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"); -- cgit v1.2.1