diff options
author | BurdetteLamar <[email protected]> | 2025-03-16 16:07:11 -0500 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2025-03-23 11:07:31 -0400 |
commit | 383af53a56f7e4a490b891701f96f91ef31e0bef () | |
tree | 0aa77c5860820be740b16f932bd5322af8dd6a64 /hash.c | |
parent | 7e0dac4cb18be87600068c346cd5339d1d880f01 (diff) |
[DOC] Doc for Hash#transform_values
Notes: Merged: https://.com/ruby/ruby/pull/12943
-rw-r--r-- | hash.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -3403,20 +3403,18 @@ transform_values_foreach_replace(st_data_t *key, st_data_t *value, st_data_t arg * transform_values {|value| ... } -> new_hash * transform_values -> new_enumerator * - * Returns a new +Hash+ object; each entry has: - * * A key from +self+. - * * A value provided by the block. * - * Transform values: * h = {foo: 0, bar: 1, baz: 2} * h1 = h.transform_values {|value| value * 100} * h1 # => {foo: 0, bar: 100, baz: 200} * - * Returns a new Enumerator if no block given: - * h = {foo: 0, bar: 1, baz: 2} - * e = h.transform_values # => #<Enumerator: {foo: 0, bar: 1, baz: 2}:transform_values> - * h1 = e.each { |value| value * 100} - * h1 # => {foo: 0, bar: 100, baz: 200} */ static VALUE rb_hash_transform_values(VALUE hash) |