instance method
values_at
Ruby on Rails 4.1.16
Since v2.2.3 Last seen in v4.2.9Signature
values_at(*indices)
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
-
indicesrest
Source
# File activesupport/lib/active_support/hash_with_indifferent_access.rb, line 175
def values_at(*indices)
indices.collect { |key| self[convert_key(key)] }
end
Defined in activesupport/lib/active_support/hash_with_indifferent_access.rb line 175
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in HashWithIndifferentAccess