[DOC] Tweaks for Hash#to_a

This commit is contained in:
BurdetteLamar 2025-03-11 17:26:57 -05:00 committed by Peter Zhu
parent 5208d2f440
commit 86eff8565b
Notes: git 2025-03-12 01:54:35 +00:00

7
hash.c
View file

@ -3421,10 +3421,13 @@ to_a_i(VALUE key, VALUE value, VALUE ary)
* call-seq: * call-seq:
* to_a -> new_array * to_a -> new_array
* *
* Returns a new Array of 2-element Array objects; * Returns all elements of +self+ as an array of 2-element arrays;
* each nested Array contains a key-value pair from +self+: * each nested array contains a key-value pair from +self+:
*
* h = {foo: 0, bar: 1, baz: 2} * h = {foo: 0, bar: 1, baz: 2}
* h.to_a # => [[:foo, 0], [:bar, 1], [:baz, 2]] * h.to_a # => [[:foo, 0], [:bar, 1], [:baz, 2]]
*
* Related: see {Methods for Converting}[rdoc-ref:Hash@Methods+for+Converting].
*/ */
static VALUE static VALUE