summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorBurdette Lamar <[email protected]>2025-03-11 10:43:50 -0500
committer<[email protected]>2025-03-11 11:43:50 -0400
commit497f409ba402ee2207f71f6998fe996433370107 ()
tree02818ebe6ef3db42861b41547c2c7bc84d9624b1 /hash.c
parente99026784a5af7b188eb8a98b708ed4b75922a6d (diff)
[DOC] Tweaks for Hash#reject (#12876)
Notes: Merged-By: peterzhu2118 <[email protected]>
-rw-r--r--hash.c19
1 files changed, 10 insertions, 9 deletions
@@ -2611,17 +2611,18 @@ rb_hash_reject_bang(VALUE hash)
* reject {|key, value| ... } -> new_hash
* reject -> new_enumerator
*
- * Returns a new +Hash+ object whose entries are all those
- * from +self+ for which the block returns +false+ or +nil+:
- * h = {foo: 0, bar: 1, baz: 2}
- * h1 = h.reject {|key, value| key.start_with?('b') }
- * h1 # => {foo: 0}
*
- * Returns a new Enumerator if no block given:
* h = {foo: 0, bar: 1, baz: 2}
- * e = h.reject # => #<Enumerator: {foo: 0, bar: 1, baz: 2}:reject>
- * h1 = e.each {|key, value| key.start_with?('b') }
- * h1 # => {foo: 0}
*/
static VALUE