[DOC] Tweaks for Hash#compact
This commit is contained in:
parent
23c4ac9559
commit
e3ad652490
Notes:
git
2025-02-16 17:57:05 +00:00
6
hash.c
6
hash.c
@ -4347,9 +4347,11 @@ delete_if_nil(VALUE key, VALUE value, VALUE hash)
|
|||||||
* compact -> new_hash
|
* compact -> new_hash
|
||||||
*
|
*
|
||||||
* Returns a copy of +self+ with all +nil+-valued entries removed:
|
* Returns a copy of +self+ with all +nil+-valued entries removed:
|
||||||
|
*
|
||||||
* h = {foo: 0, bar: nil, baz: 2, bat: nil}
|
* h = {foo: 0, bar: nil, baz: 2, bat: nil}
|
||||||
* h1 = h.compact
|
* h.compact # => {foo: 0, baz: 2}
|
||||||
* h1 # => {foo: 0, baz: 2}
|
*
|
||||||
|
* Related: see {Methods for Deleting}[rdoc-ref:Hash@Methods+for+Deleting].
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user