method
values_at
![Moderate documentation Importance_2](https://d2vfyqvduarcvs.cloudfront.net/images/importance_2.png?1349367920)
values_at(*args)
public
Register or
log in
to add new notes.
earless1 -
April 2, 2013 - (v1_8_6_287 - v1_9_3_392)
![Default_avatar_30](https://www.gravatar.com/avatar/72cfdebdbcafd84e5ec3efbda43abb8f?size=30&default=http://apidock.com/images/default_avatar_30.png)
0 thanks
Passing in an Array instead of individual arguments
Pass in array instead of list
h = { "cat" => "feline", "dog" => "canine", "cow" => "bovine" } keys_i_want = %w(cow cat) h.values_at(*keys_i_want) #=> ["bovine", "feline"]