summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurdetteLamar <burdettelamar@yahoo.com>2025-02-17 11:27:56 -0600
committerPeter Zhu <peter@peterzhu.ca>2025-02-17 19:06:22 -0500
commit047a05ea43cc9a621b239fbf16480954398772b6 (patch)
tree04ebdb39c73c63824e15d3e416c29a4e045ff44e
parent2db365dc83b3bc5e5bc15d93b5cd44b048188361 (diff)
[DOC] Tweaks for Hash#delete_if
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12766
-rw-r--r--hash.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hash.c b/hash.c
index bb2eb682e9..ddfe8e6265 100644
--- a/hash.c
+++ b/hash.c
@@ -2543,16 +2543,16 @@ hash_enum_size(VALUE hash, VALUE args, VALUE eobj)
* delete_if {|key, value| ... } -> self
* delete_if -> new_enumerator
*
- * If a block given, calls the block with each key-value pair;
- * deletes each entry for which the block returns a truthy value;
- * returns +self+:
+ * With a block given, calls the block with each key-value pair,
+ * deletes each entry for which the block returns a truthy value,
+ * and returns +self+:
+ *
* h = {foo: 0, bar: 1, baz: 2}
* h.delete_if {|key, value| value > 0 } # => {foo: 0}
*
- * If no block given, returns a new Enumerator:
- * h = {foo: 0, bar: 1, baz: 2}
- * e = h.delete_if # => #<Enumerator: {foo: 0, bar: 1, baz: 2}:delete_if>
- * e.each { |key, value| value > 0 } # => {foo: 0}
+ * With no block given, returns a new Enumerator.
+ *
+ * Related: see {Methods for Deleting}[rdoc-ref:Hash@Methods+for+Deleting].
*/
VALUE