Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def merge!(other)
- other = Rubinius::Type.coerce_to other, Hash, :to_hash
- if block_given?
- other.each_entry do |entry|
- key = entry.key
- if key? key
- __store__ key, yield(key, self[key], entry.value)
- else
- __store__ key, entry.value
- end
- end
- else
- other.each_entry do |entry|
- key = entry.key
- __store__ key, entry.value
- end
- end
- self
- end
Add Comment
Please, Sign In to add comment