diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-20 10:11:25 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-20 10:11:25 +0000 |
commit | 33e064affff29ac2a59dbc4d6a9e47b26da39080 (patch) | |
tree | 07a9cd7942d325708726e9ae4446c1781396f4b4 | |
parent | 50b775851ad4cdae41b05bd133683f8894500674 (diff) | |
download | ruby-33e064affff29ac2a59dbc4d6a9e47b26da39080.tar.gz |
* lib/ostruct.rb (OpenStruct#initialize_copy): should not share
members. [ruby-dev:22966]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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 |