[DOC] Tweaks for Hash#values_at

This commit is contained in:
BurdetteLamar 2025-03-26 16:00:20 -05:00 committed by Peter Zhu
parent dbc1ceca32
commit 9e87323ad0
Notes: git 2025-03-29 21:05:37 +00:00

6
hash.c
View file

@ -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