instance method
values_at
Ruby on Rails 7.1.6
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 237
def values_at(*keys)
keys.map! { |key| convert_key(key) }
super
end
Defined in activesupport/lib/active_support/hash_with_indifferent_access.rb line 237
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::HashWithIndifferentAccess