summaryrefslogtreecommitdiff
path: root/NEWS.md
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2021-10-28 14:07:11 +0200
committerJean Boussier <jean.boussier@gmail.com>2021-11-23 10:50:44 +0100
commitc0c2b31a35e19a47b499b57807bc0a0f9325f6d3 (patch)
treeab7ee0710597903b43a8d086a3805059693de928 /NEWS.md
parenta88b19d3d08447eeb7045621f02a844173d64203 (diff)
Add Class#subclasses
Implements [Feature #18273] Returns an array containing the receiver's direct subclasses without singleton classes.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5045
Diffstat (limited to 'NEWS.md')
-rw-r--r--NEWS.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/NEWS.md b/NEWS.md
index 3e8035714b..df58f5a457 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -121,6 +121,21 @@ Outstanding ones only.
C.descendants #=> []
```
+ * Class#subclasses, which returns an array of classes
+ directly inheriting from the receiver, not
+ including singleton classes.
+ [[Feature #18273]]
+
+ ```ruby
+ class A; end
+ class B < A; end
+ class C < B; end
+ class D < A; end
+ A.subclasses #=> [D, B]
+ B.subclasses #=> [C]
+ C.subclasses #=> []
+ ```
+
* Enumerable
* Enumerable#compact is added. [[Feature #17312]]
@@ -457,6 +472,7 @@ See [the repository](https://github.com/ruby/error_highlight) in detail.
[Feature #18172]: https://bugs.ruby-lang.org/issues/18172
[Feature #18229]: https://bugs.ruby-lang.org/issues/18229
[Feature #18290]: https://bugs.ruby-lang.org/issues/18290
+[Feature #18273]: https://bugs.ruby-lang.org/issues/18273
[GH-1509]: https://github.com/ruby/ruby/pull/1509
[GH-4815]: https://github.com/ruby/ruby/pull/4815