Skip to content

Instantly share code, notes, and snippets.

@pooza pooza/config.rb
Created Jan 24, 2019

Embed
What would you like to do?
module MulukhiyaTootProxy
class Config < Ginseng::Config
include Package
def self.deep_merge(src, target)
raise ArgumentError 'Not Hash' unless target.is_a?(Hash)
dest = (src.clone || {}).with_indifferent_access
target.each do |k, v|
dest[k] = v.is_a?(Hash) ? deep_merge(dest[k], v) : v
end
return dest.compact
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.