replace(other) -> self
[permalink][rdoc]self の内容を other の内容で置き換えます。
require 'gdbm' db1 = GDBM.open('aaa.gdbm', 0666, GDBM::NEWDB) db1['a'] = 'aaa' db1['b'] = 'bbb' db2 = GDBM.open('bbb.gdbm', 0666, GDBM::NEWDB) db2['c'] = 'ccc' db2['d'] = 'ddd' hash = { 'x' => 'xxx', 'y' => 'yyy'} p db1 #=> #<GDBM:0xb7d1c8a8> p db1.replace(db2) #=> #<GDBM:0xb7d1c8a8> p db1.replace(hash) #=> #<GDBM:0xb7d1c8a8>