class Hash
Public Instance Methods
slice(*keys)
click to toggle source
File activesupport/lib/active_support/core_ext/hash/slice.rb, line 21
# File lib/core_ext/hash.rb, line 5 def slice(*keys) keys.map! { |key| convert_key(key) } if respond_to?(:convert_key, true) keys.each_with_object(self.class.new) { |k, hash| hash[k] = self[k] if key?(k) } end