> #dup creates a copy of an object with a different object_id. As
> follows:
<กฤ>

>> a = ["bar", "baz"]
=> ["bar", "baz"]
>> b = a.dup
=> ["bar", "baz"]
>> c = Marshal.load(Marshal.dump(a))
=> ["bar", "baz"]
>> b[0] << "s"
=> "bars"
>> b
=> ["bars", "baz"]
>> a
=> ["bars", "baz"]
>> c
=> ["bar", "baz"]
>> a.object_id
=> 2157344160
>> b.object_id
=> 2157338800
>> c.object_id
=> 2157328340
>> a[0].object_id
=> 2157344140
>> b[0].object_id
=> 2157344140
>> c[0].object_id
=> 2157328320

Regards,
Rimantas
--
http://rimantas.com