That's because the hash (I mean the result of #hash) of both
OpenStruct objects differ.

$ ri Object#hash

.... gives you:

"Generates a +Fixnum+ hash value for this object. This function
must have the property that +a.eql?(b)+ implies +a.hash ==
b.hash+. The hash value is used by class +Hash+. Any hash value
that exceeds the capacity of a +Fixnum+ will be truncated
before being used."

gegroet,
Erik V. - http://www.erikveen.dds.nl/

----------------------------------------------------------------

 require "ostruct"

 o1 = OpenStruct.new
 o1.foo = "a"
 o1.bar = "b"

 o2 = OpenStruct.new
 o2.foo = "a"
 o2.bar = "b"

 p o1.hash
 p o2.hash

----------------------------------------------------------------