instance method
values_at
Ruby on Rails 4.0.13
Since v3.0.20Signature
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 ActiveSupport::HashWithIndifferentAccess