From: Minkoo Seo Date: 2006-02-11T18:38:24+09:00 Subject: OpenStruct problem OpenStruct class seems to be misbehave when it comes to hashing. For example, irb(main):008:0> o1 = OpenStruct.new => irb(main):009:0> o1.val = "a" => "a" irb(main):010:0> o1 = OpenStruct.new => irb(main):011:0> o1.foo = "a" => "a" irb(main):012:0> o1.bar = "b" => "b" irb(main):013:0> o2 = OpenStruct.new => irb(main):014:0> o2.foo = "a" => "a" irb(main):015:0> o2.bar = "b" => "b" irb(main):016:0> h = { o1 => 1 } => {=>1} irb(main):017:0> h[o2] => nil irb(main):018:0> If it's not possible to retrieve the same hash entry using OpenStruct, what should I have to use instead? Don't you think OpenStruct have to support eql? method automatically? Best, Minkoo Seo