push
travis-ci
492 of 508 relevant lines covered (96.85%)
26.08 hits per line
1 |
class Hash |
2 all except jruby-head ✔ |
2 |
|
|
3 |
def deep_merge(other_hash) |
2 all except jruby-head ✔ |
4 |
dup.deep_merge!(other_hash) |
46 all except jruby-head ✔ |
5 |
end
|
|
6 |
|
|
7 |
def deep_merge!(other_hash) |
2 all except jruby-head ✔ |
8 |
other_hash.each_pair do |k,v|
|
46 all except jruby-head ✔ |
9 |
tv = self[k]
|
50 all except jruby-head ✔ |
10 |
self[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? tv.deep_merge(v) : v |
50 all except jruby-head ✔ |
11 |
end
|
|
12 |
self
|
46 all except jruby-head ✔ |
13 |
end
|
× |
14 |
|
|
15 |
end
|