Bug #6028

OpenStruct.dup doesn't have all its methods

Added by Marc-Andre Lafortune about 2 years ago. Updated about 2 years ago.

[ruby-core:42647]
Status:Closed
Priority:Normal
Assignee:Marc-Andre Lafortune
Category:lib
Target version:1.9.3
ruby -v:r34609 Backport:

Description

Dupped OpenStructs don't have the same methods.

x = OpenStuct.new(foo: 42)
x.dup.methods == x.methods # => false
x.respond_to?(:foo) # => true
x.dup.respond_to?(:foo) # => false

Associated revisions

Revision 34620
Added by Marc-Andre Lafortune about 2 years ago

  • lib/ostruct.rb: Create getters and setters after dup. [Bug #6028] [rubyspecs:0380bcc]

History

#1 Updated by Marc-Andre Lafortune about 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r34620.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/ostruct.rb: Create getters and setters after dup. [Bug #6028] [rubyspecs:0380bcc]

Also available in: Atom PDF