Method: Hash#permit

Defined in:
lib/functional_support/core_ext/hash.rb

#permit(*keys) ⇒ Object



46
47
48
49
50
51
# File 'lib/functional_support/core_ext/hash.rb', line 46

def permit(*keys)
  keys.reduce(self.class.new) do |hash, key|
    hash[key] = self[key] if self.has_key?(key)
    hash
  end
end