Add deep_merge helper method to Hash class if not already present
12 13 14 15 16 17 18 19 20
# File 'lib/sxn/templates/template_engine.rb', line 12 def deep_merge(other_hash) merge(other_hash) do |_key, oldval, newval| if oldval.is_a?(Hash) && newval.is_a?(Hash) oldval.deep_merge(newval) else newval end end end