Sha256: 9d43ffd216c3057590ce683274d21c947942c8f687abbad0559d5d6b12d5d124

Contents?: true

Size: 335 Bytes

Versions: 10

Compression:

Stored size: 335 Bytes

Contents

# 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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
intranet-core-2.4.5 lib/core_extensions/hash.rb
intranet-core-2.4.4 lib/core_extensions/hash.rb
intranet-core-2.4.3 lib/core_extensions/hash.rb
intranet-core-2.4.1 lib/core_extensions/hash.rb
intranet-core-2.4.0 lib/core_extensions/hash.rb
intranet-core-2.3.3 lib/core_extensions/hash.rb
intranet-core-2.3.2 lib/core_extensions/hash.rb
intranet-core-2.3.1 lib/core_extensions/hash.rb
intranet-core-2.3.0 lib/core_extensions/hash.rb
intranet-core-2.2.0 lib/core_extensions/hash.rb