Sha256: 12b1abc72c25a66867cfbbcc1f713c282e844936733f2a8b1e3edbf34ca2e97b
Contents?: true
Size: 303 Bytes
Versions: 33
Compression:
Stored size: 303 Bytes
Contents
unless {}.respond_to?(:deep_dup) class Hash # Returns a deep copy of hash. def deep_dup duplicate = self.dup duplicate.each_pair do |k,v| tv = duplicate[k] duplicate[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? tv.deep_dup : v end duplicate end end end
Version data entries
33 entries across 23 versions & 2 rubygems