summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurdetteLamar <burdettelamar@yahoo.com>2025-02-15 10:46:46 -0600
committerPeter Zhu <peter@peterzhu.ca>2025-02-16 12:56:48 -0500
commite3ad6524906231d6bd72b5f568651ab142c68764 (patch)
tree04c1555fa7b68081d5dcf138da524e81cc34497a
parent23c4ac9559a05d7be4534d8e552d8dc95e272867 (diff)
[DOC] Tweaks for Hash#compact
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12755
-rw-r--r--hash.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index b959747206..1a17d15acf 100644
--- a/hash.c
+++ b/hash.c
@@ -4347,9 +4347,11 @@ delete_if_nil(VALUE key, VALUE value, VALUE hash)
* compact -> new_hash
*
* Returns a copy of +self+ with all +nil+-valued entries removed:
+ *
* h = {foo: 0, bar: nil, baz: 2, bat: nil}
- * h1 = h.compact
- * h1 # => {foo: 0, baz: 2}
+ * h.compact # => {foo: 0, baz: 2}
+ *
+ * Related: see {Methods for Deleting}[rdoc-ref:Hash@Methods+for+Deleting].
*/
static VALUE