hashr 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hashr/core_ext/ruby/hash.rb +2 -5
- data/lib/hashr/version.rb +1 -1
- metadata +3 -3
@@ -18,11 +18,8 @@ class Hash
|
|
18
18
|
end unless Hash.method_defined?(:deep_symbolize_keys)
|
19
19
|
|
20
20
|
# deep_merge_hash! by Stefan Rusterholz, see http://www.ruby-forum.com/topic/142809
|
21
|
-
MERGER = proc do |key, v1, v2|
|
22
|
-
Hash === v1 && Hash === v2 ? v1.merge(v2, &MERGER) : v2
|
23
|
-
end
|
24
|
-
|
25
21
|
def deep_merge(other)
|
26
|
-
merge(
|
22
|
+
merger = proc { |key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2 }
|
23
|
+
merge(other, &merger)
|
27
24
|
end unless Hash.method_defined?(:deep_merge)
|
28
25
|
end
|
data/lib/hashr/version.rb
CHANGED
metadata
CHANGED