OpenStructuses a combination of calls define_methodinside validation unless self.respond_to?(name)and method_missing. This means that if the property name conflicts with the name of any existing method on the object, you will run into this problem.
tokland , , , id, .
test.instance_eval('undef id')
OpenStruct, .
class OpenStruct2 < OpenStruct
undef id
end
irb(main):009:0> test2 = OpenStruct2.new({:id => 666})
=> #<OpenStruct2 id=666>
irb(main):010:0> test2.id
=> 666