mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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>
This commit is contained in:
parent
a4d5ee4f31
commit
717ab0bb2e
Notes:
git
2021-10-27 04:35:44 +09:00
Merged: https://github.com/ruby/ruby/pull/4974 Merged-By: jeremyevans <code@jeremyevans.net>
6 changed files with 122 additions and 0 deletions
|
@ -174,6 +174,19 @@ VALUE rb_mod_include_p(VALUE child, VALUE parent);
|
|||
*/
|
||||
VALUE rb_mod_ancestors(VALUE mod);
|
||||
|
||||
/**
|
||||
* Queries the class's descendants. This routine gathers classes that are
|
||||
* subclasses of the given class (or subclasses of those subclasses, etc.),
|
||||
* returning an array of classes that have the given class as an ancestor.
|
||||
* The returned array does not include the given class or singleton classes.
|
||||
*
|
||||
* @param[in] klass A class.
|
||||
* @return An array of classes where `klass` is an ancestor.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
VALUE rb_class_descendants(VALUE klass);
|
||||
|
||||
/**
|
||||
* Generates an array of symbols, which are the list of method names defined in
|
||||
* the passed class.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue