summaryrefslogtreecommitdiff
path: root/NEWS.md
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 /NEWS.md
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 'NEWS.md')
-rw-r--r--NEWS.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/NEWS.md b/NEWS.md
index f2c13859fa..0e8a5fc163 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -96,6 +96,22 @@ Outstanding ones only.
* Array#intersect? is added. [[Feature #15198]]
+* Class
+
+ * Class#descendants, which returns an array of classes
+ directly or indirectly inheriting from the receiver, not
+ including the receiver or singleton classes.
+ [[Feature #14394]]
+
+ ```ruby
+ class A; end
+ class B < A; end
+ class C < B; end
+ A.descendants #=> [B, C]
+ B.descendants #=> [C]
+ C.descendants #=> []
+ ```
+
* Enumerable
* Enumerable#compact is added. [[Feature #17312]]
@@ -358,6 +374,7 @@ See [the repository](https://github.com/ruby/error_highlight) in detail.
[Bug #4443]: https://bugs.ruby-lang.org/issues/4443
[Feature #12194]: https://bugs.ruby-lang.org/issues/12194
[Feature #14256]: https://bugs.ruby-lang.org/issues/14256
+[Feature #14394]: https://bugs.ruby-lang.org/issues/14394
[Feature #14579]: https://bugs.ruby-lang.org/issues/14579
[Feature #15198]: https://bugs.ruby-lang.org/issues/15198
[Feature #15211]: https://bugs.ruby-lang.org/issues/15211