call to_hash before replacing hash

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-04-04 10:55:48 +09:00
parent b8ab6af39d
commit 786ed10d59
+1
View File
@@ -156,6 +156,7 @@ class Hash
# ISO 15.2.13.4.23
def replace(hash)
self.clear
hash = hash.to_hash
hash.each_key{|k|
self[k] = hash[k]
}