class ActiveSupport::HashWithIndifferentAccess

def dup

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

dup[:a][:c] = 'c'
dup = hash.dup
hash = ActiveSupport::HashWithIndifferentAccess.new({ a: { b: 'b' } })

Returns a shallow copy of the hash.
def dup
  self.class.new(self).tap do |new_hash|
    set_defaults(new_hash)
  end
end