Sha256: 46ebb73cc0d7d2eeb53ae4ca8af1ac02165a2d7ed9be5f6b972cdcb86df01aab

Contents?: true

Size: 408 Bytes

Versions: 6

Compression:

Stored size: 408 Bytes

Contents

# This file contains various useful bits of code
# that are shared between Haml and Sass.

class Hash # :nodoc:
  # Same as Hash#merge!,
  # but recursively merges sub-hashes
  def rec_merge!(other)
    other.each do |key, value|
      myval = self[key]
      if value.is_a?(Hash) && myval.is_a?(Hash)
        myval.rec_merge!(value)
      else
        self[key] = value
      end
    end
    self
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
haml-1.7.1 lib/haml/util.rb
haml-1.7.2 lib/haml/util.rb
haml-1.8.0 lib/haml/util.rb
haml-1.7.0 lib/haml/util.rb
haml-1.8.2 lib/haml/util.rb
haml-1.8.1 lib/haml/util.rb