Method: Hanami::Utils::Hash.deep_dup
- Defined in:
- lib/hanami/utils/hash.rb
.deep_dup(input) ⇒ ::Hash
Deep duplicates hash values
The output of this function is a deep duplicate of the input. Any further modification on the input, won’t be reflected on the output and viceversa.
135 136 137 138 139 140 141 142 143 144 |
# File 'lib/hanami/utils/hash.rb', line 135 def self.deep_dup(input) input.transform_values do |v| case v when ::Hash deep_dup(v) else v.dup end end end |