Method: Ardm::Ext::Hash.except!

Defined in:
lib/ardm/support/ext/hash.rb

.except!(hash, *keys) ⇒ Hash

Removes the specified keys from the given hash.

Examples:

hash = { :one => 1, :two => 2, :three => 3 }
Ext::Hash.except!(hash, :one, :two)
hash # => { :three => 3 }

Parameters:

  • hash (Hash)

    The hash to modify.

  • *keys (Array)

    The hash keys to exclude.

Returns:



50
51
52
53
# File 'lib/ardm/support/ext/hash.rb', line 50

def self.except!(hash, *keys)
  keys.each { |key| hash.delete(key) }
  hash
end