# frozen_string_literal: true module CoreExtensions # Extension of Ruby's standard library +Hash+ class. module Hash # Returns a copy of a hash with +keys+ excluded. Original hash is not # modified. # @return [Hash] def except(*keys) h = dup keys.each { |key| h.delete(key) } h end end end