# File lib/table_print/hash_extensions.rb, line 4 def constructive_merge(hash) target = dup hash.keys.each do |key| if hash[key].is_a? Hash and self[key].is_a? Hash target[key].extend ConstructiveMerge target[key] = target[key].constructive_merge(hash[key]) next end target[key] = hash[key] end target end
# File lib/table_print/hash_extensions.rb, line 20 def constructive_merge!(hash) target = self hash.keys.each do |key| if hash[key].is_a? Hash and self[key].is_a? Hash target[key].extend ConstructiveMerge target[key] = target[key].constructive_merge(hash[key]) next end target[key] = hash[key] end target end
Generated with the Darkfish Rdoc Generator 2.