Module: CoreExtensions::Hash

Defined in:
lib/core_extensions/hash.rb

Overview

Extension of Ruby’s standard library Hash class.

Instance Method Summary collapse

Instance Method Details

#except(*keys) ⇒ Hash

Returns a copy of a hash with keys excluded. Original hash is not modified.

Returns:



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