Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v2.3.8) is shown here.
slice(*keys)
public
Returns a new hash with only the given keys.
# File activesupport/lib/active_support/core_ext/hash/slice.rb, line 19
def slice(*keys)
keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key)
hash = self.class.new
keys.each { |k| hash[k] = self[k] if has_key?(k) }
hash
end