summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorBurdette Lamar <[email protected]>2025-03-11 14:18:47 -0500
committer<[email protected]>2025-03-11 15:18:47 -0400
commita5f29213dcd3bd3da896c34505d487569c9ad339 ()
tree22692efbe5028078364c9756d2b8470c173f5039 /hash.c
parent51e2ff1ef777f82b0898f30b636a29b92e63a2e1 (diff)
[DOC] Tweaks for Hash#select (#12903)
Notes: Merged-By: peterzhu2118 <[email protected]>
-rw-r--r--hash.c11
1 files changed, 6 insertions, 5 deletions
@@ -2779,14 +2779,15 @@ keep_if_i(VALUE key, VALUE value, VALUE hash)
* select {|key, value| ... } -> new_hash
* select -> new_enumerator
*
- * Returns a new +Hash+ object whose entries are those for which the block returns a truthy value:
* h = {foo: 0, bar: 1, baz: 2}
* h.select {|key, value| value < 2 } # => {foo: 0, bar: 1}
*
- * Returns a new Enumerator if no block given:
- * h = {foo: 0, bar: 1, baz: 2}
- * e = h.select # => #<Enumerator: {foo: 0, bar: 1, baz: 2}:select>
- * e.each {|key, value| value < 2 } # => {foo: 0, bar: 1}
*/
static VALUE