From: Thomas Sawyer Date: 2012-02-22T03:45:15+09:00 Subject: [ruby-core:42781] [ruby-trunk - Feature #6056] Enhancements to OpenStruct Issue #6056 has been updated by Thomas Sawyer. Each change should be separate pull request or just a separate commit? I knew about issue #6029, I was just trying to take care of that a couple of other features while I was involved with the code. I see what you are saying about ==. I am actually surprised that: class Q def to_ary; [1,2,3]; end end Q.new == [1,2,3] #=> false But that being the case, then okay I will remove. I will also remove .dup from marshal_dump. I will submit new issue about BasicObject, but briefly, the reason is for of use with #method_missing, to get as many methods out of the way as possible for it's use. ---------------------------------------- Feature #6056: Enhancements to OpenStruct https://bugs.ruby-lang.org/issues/6056 Author: Thomas Sawyer Status: Open Priority: Normal Assignee: Marc-Andre Lafortune Category: lib Target version: 2.0.0 This patch fixes one issue, protecting #new_ostruct_member method, and possibly another by dup'ing marshal_dump, but I need more feedback on the later b/c I've also been told it is not needed. The rest of this patch provides enhancements to OpenStruct that I feel are sorely needed, these include access via [] and []=, ability to mass update via merge!, minimal polymorphism with Hash and the addition of equality methods, eql? and ==. https://github.com/ruby/ruby/pull/95 I'd also like opinions on further enhancements: * adding #each and #each_pair * making OpenStruct a subclass of BasicObject -- http://bugs.ruby-lang.org/