Hi,
I need some help with the the #my_merge method. I’m unable to pass the last two tests and I’m not really sure what direction I’m supposed to be going with this. Some detailed guidance would be greatly appreciated. Thanks!
Here’s what my code looks like:
def my_merge(hash2, &prc)
new_hash = self
if prc
hash2.each do |k2, v2|
new_hash[k2] = prc.call(k2, new_hash[k2], v2)
end
else
hash2.each do |k2, v2|
new_hash[k2] = v2
end
end
new_hash
end