Sha256: 27c84fb375608c17fd98865f2da9ae1233374344cfe010f4c22b47dd1cec44e3

Contents?: true

Size: 402 Bytes

Versions: 4

Compression:

Stored size: 402 Bytes

Contents

module Loader
  module HashEXT
    class << self

      def deep_merge(self_hash,other_hash)
        deep_merge!(self_hash.dup,other_hash)
      end

      def deep_merge!(self_hash,other_hash)
        other_hash.each_pair do |k,v|
          tv = self_hash[k]
          self_hash[k] = tv.is_a?(::Hash) && v.is_a?(::Hash) ? deep_merge(tv,v) : v
        end
        self_hash
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
loader-1.4.2 lib/loader/hash.rb
loader-1.4.1 lib/loader/hash.rb
loader-1.3.2 lib/loader/hash.rb
loader-1.3.1 lib/loader/hash.rb