Skip to content

Commit 3bbb029

Browse files
[DOC] Tweaks for Hash#invert
1 parent 43a729b commit 3bbb029

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hash.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3938,15 +3938,19 @@ rb_hash_invert_i(VALUE key, VALUE value, VALUE hash)
39383938
* call-seq:
39393939
* invert -> new_hash
39403940
*
3941-
* Returns a new +Hash+ object with the each key-value pair inverted:
3941+
* Returns a new hash with each key-value pair inverted:
3942+
*
39423943
* h = {foo: 0, bar: 1, baz: 2}
39433944
* h1 = h.invert
39443945
* h1 # => {0=>:foo, 1=>:bar, 2=>:baz}
39453946
*
3946-
* Overwrites any repeated new keys:
3947+
* Overwrites any repeated new keys
39473948
* (see {Entry Order}[rdoc-ref:Hash@Entry+Order]):
3949+
*
39483950
* h = {foo: 0, bar: 0, baz: 0}
39493951
* h.invert # => {0=>:baz}
3952+
*
3953+
* Related: see {Methods for Transforming Keys and Values}[rdoc-ref:Hash@Methods+for+Transforming+Keys+and+Values].
39503954
*/
39513955

39523956
static VALUE

0 commit comments

Comments
 (0)