Top Level Namespace
Defined Under Namespace
Modules: Nicos Classes: Numeric
Instance Method Summary collapse
-
#mixinND(targetObj, overWriteObj) ⇒ Object
mixin non destructive.
Instance Method Details
#mixinND(targetObj, overWriteObj) ⇒ Object
mixin non destructive
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/classes/tools.rb', line 4 def mixinND(targetObj, overWriteObj) output = Marshal.load(Marshal.dump(targetObj)) if targetObj.instance_of?(Hash) overWriteObj.each_key { |key| overWriteObj[key] = mixinND(targetObj[key], overWriteObj[key]) output[key] = overWriteObj[key] } else output = overWriteObj end return output end |