Sha256: 6ae9955965d9b5e6882be0c2f1c11d6209070d62a62665dcf769eddf5609f4c6
Contents?: true
Size: 304 Bytes
Versions: 12
Compression:
Stored size: 304 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
12 entries across 12 versions & 2 rubygems