summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-10-26 10:35:21 -0900
committerGitHub <noreply@github.com>2021-10-26 12:35:21 -0700
commit717ab0bb2ee63dfe76076e0c9f91fbac3a0de4fd (patch)
treed2b531647657dd58e6ce6e64e3f6fa0adaa75f40 /object.c
parenta4d5ee4f31bf3ff36c1a8c8fe3cda16aa1016b12 (diff)
Add Class#descendants
Doesn't include receiver or singleton classes. Implements [Feature #14394] Co-authored-by: fatkodima <fatkodima123@gmail.com> Co-authored-by: Benoit Daloze <eregontp@gmail.com>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4974 Merged-By: jeremyevans <code@jeremyevans.net>
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 5eca02a08c..f98fb83936 100644
--- a/object.c
+++ b/object.c
@@ -4653,6 +4653,7 @@ InitVM_Object(void)
rb_define_method(rb_cClass, "new", rb_class_new_instance_pass_kw, -1);
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, "descendants", rb_class_descendants, 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");