mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[DOC] Tweaks for Hash#values_at
This commit is contained in:
parent
dbc1ceca32
commit
9e87323ad0
Notes:
git
2025-03-29 21:05:37 +00:00
1 changed files with 5 additions and 1 deletions
6
hash.c
6
hash.c
|
@ -2711,13 +2711,17 @@ rb_hash_except(int argc, VALUE *argv, VALUE hash)
|
|||
* call-seq:
|
||||
* values_at(*keys) -> new_array
|
||||
*
|
||||
* Returns a new Array containing values for the given +keys+:
|
||||
* Returns a new array containing values for the given +keys+:
|
||||
*
|
||||
* h = {foo: 0, bar: 1, baz: 2}
|
||||
* h.values_at(:baz, :foo) # => [2, 0]
|
||||
*
|
||||
* The {hash default}[rdoc-ref:Hash@Hash+Default] is returned
|
||||
* for each key that is not found:
|
||||
*
|
||||
* h.values_at(:hello, :foo) # => [nil, 0]
|
||||
*
|
||||
* Related: see {Methods for Fetching}[rdoc-ref:Hash@Methods+for+Fetching].
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue