# class Hash

### Public Instance Methods

deep_dup() click to toggle source

Returns a deep copy of hash.

    hash = { a: { b: 'b' } }
    dup  = hash.deep_dup
    dup[:a][:c] = 'c'

    hash[:a][:c] # => nil
    dup[:a][:c]  # => "c"

    # File sentry-raven/lib/raven/core_ext/object/deep_dup.rb, line 45
    def deep_dup
      hash = dup
      each_pair do |key, value|
        if key.frozen? && ::String === key
          hash[key] = value.deep_dup
        else
          hash.delete(key)
          hash[key.deep_dup] = value.deep_dup
        end
      end
      hash
    end