summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorBurdette Lamar <[email protected]>2025-02-26 08:28:52 -0600
committer<[email protected]>2025-02-26 09:28:52 -0500
commit3bbb029d449868e5f371cc5c2311366fa33218cb ()
tree351b2138bca696e933785ab607008653332bb799 /hash.c
parent43a729b1be1c03499e1fa8475364708f4a1ca39e (diff)
[DOC] Tweaks for Hash#invert
Notes: Merged: https://.com/ruby/ruby/pull/12808 Merged-By: peterzhu2118 <[email protected]>
-rw-r--r--hash.c8
1 files changed, 6 insertions, 2 deletions
@@ -3938,15 +3938,19 @@ rb_hash_invert_i(VALUE key, VALUE value, VALUE hash)
* call-seq:
* invert -> new_hash
*
- * Returns a new +Hash+ object with the each key-value pair inverted:
* h = {foo: 0, bar: 1, baz: 2}
* h1 = h.invert
* h1 # => {0=>:foo, 1=>:bar, 2=>:baz}
*
- * Overwrites any repeated new keys:
* (see {Entry Order}[rdoc-ref:Hash@Entry+Order]):
* h = {foo: 0, bar: 0, baz: 0}
* h.invert # => {0=>:baz}
*/
static VALUE