instance method
values_at
Ruby on Rails 7.0.10
Since v3.0.20Signature
values_at(*keys)
Returns an array of the values at the specified indices:
hash = ActiveSupport::HashWithIndifferentAccess.new hash[:a] = 'x' hash[:b] = 'y' hash.values_at('a', 'b') # => ["x", "y"]
Parameters
-
keysrest
Source
# File activesupport/lib/active_support/hash_with_indifferent_access.rb, line 231
def values_at(*keys)
super(*keys.map { |key| convert_key(key) })
end
Defined in activesupport/lib/active_support/hash_with_indifferent_access.rb line 231
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::HashWithIndifferentAccess