diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/ostruct.rb | 6 |
2 files changed, 11 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Fri Feb 20 19:11:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/ostruct.rb (OpenStruct#initialize_copy): should not share + members. [ruby-dev:22966] + Fri Feb 20 18:59:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org> * lib/irb/init.rb (IRB::IRB.parse_opts): add -I option to diff --git a/lib/ostruct.rb b/lib/ostruct.rb index 786bd4de20..b0bb775263 100644 --- a/lib/ostruct.rb +++ b/lib/ostruct.rb @@ -52,6 +52,12 @@ class OpenStruct end end + # Duplicate an OpenStruct object members. + def initialize_copy(orig) + super + @table = @table.dup + end + def method_missing(mid, *args) # :nodoc: mname = mid.id2name len = args.length |