Module: CoreExtensions::Hash
- Defined in:
- lib/core_extensions/hash.rb
Overview
Extension of Ruby’s standard library Hash
class.
Instance Method Summary collapse
-
#except(*keys) ⇒ Hash
Returns a copy of a hash with
keys
excluded.
Instance Method Details
#except(*keys) ⇒ Hash
Returns a copy of a hash with keys
excluded. Original hash is not modified.
9 10 11 12 13 |
# File 'lib/core_extensions/hash.rb', line 9 def except(*keys) h = dup keys.each { |key| h.delete(key) } h end |