mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[DOC] Tweaks for Hash#to_a
This commit is contained in:
parent
5208d2f440
commit
86eff8565b
Notes:
git
2025-03-12 01:54:35 +00:00
1 changed files with 5 additions and 2 deletions
7
hash.c
7
hash.c
|
@ -3421,10 +3421,13 @@ to_a_i(VALUE key, VALUE value, VALUE ary)
|
|||
* call-seq:
|
||||
* to_a -> new_array
|
||||
*
|
||||
* Returns a new Array of 2-element Array objects;
|
||||
* each nested Array contains a key-value pair from +self+:
|
||||
* Returns all elements of +self+ as an array of 2-element arrays;
|
||||
* each nested array contains a key-value pair from +self+:
|
||||
*
|
||||
* h = {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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue