# frozen_string_literal: true class Hash # Removes the given keys from hash and returns it. # hash = { a: true, b: false, c: nil } # hash.except!(:c) # => { a: true, b: false } # hash # => { a: true, b: false } def except!(*keys) keys.each { |key| delete(key) } self end end