From: Dmitry Perfilyev Date: 2008-12-11T08:57:18+09:00 Subject: why Hash corrupts 'key' object ? Hi, I have next script: t.rb: =========================== class TestStr < String attr_accessor :dupstr def initialize ( str ) @dupstr = str super(str) end end ts=TestStr.new("aaa") puts ts.dupstr h=Hash.new() h[ts]=true puts h.keys.first.class puts h.keys.first puts h.keys.first.dupstr =========================== run it: $ ruby t.rb aaa TestStr aaa nil $ The question is - why there is 'nil' in the last line instead of "aaa" ? -- Posted via http://www.ruby-forum.com/.