lib/surrealist/copier.rb
# Goes through the hash recursively and deeply copies it.
#
# @param [Hash] hash the hash to be copied.
# @param [Hash] wrapper the wrapper of the resulting hash.
#
# @return [Hash] deeply copied hash.
Goes through the hash recursively and deeply copies it.
Goes through the hash recursively and deeply copies it .
def deep_copy(hash, wrapper = {})
        hash.each_with_object(wrapper) do |(key, value), new|
          new[key] = value.is_a?(Hash) ? deep_copy(value) : value
        end
      end
def deep_copy ( hash , wrapper = { } ) hash . each_with_object ( wrapper ) do | ( key , value ) , new | new [ key ] = value . is_a? ( Hash ) ? deep_copy ( value ) : value end end
Goes through the hash recursively and deeply copies it.
Goes through the hash recursively and deeply copies it .
deeply copied hash.
deeply copied hash .
Hash
hash
<not_specific>
wrapper
<not_specific>
<not_specific>
wrapper the wrapper of the resulting hash.
wrapper the wrapper of the resulting hash .