class Hash
Public Instance Methods
slice( *other_keys )
click to toggle source
return a hash containing only the specified keys
# File lib/philtre/core_extensions.rb, line 24 def slice( *other_keys ) other_keys.inject(Hash.new) do |hash, key| hash[key] = self[key] if has_key?( key ) hash end end