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 | d3c072dfe70706842afd861ba2f4f866f3469a38 (patch) | |
tree | 07a9cd7942d325708726e9ae4446c1781396f4b4 /lib | |
parent | 3d030940e9944c4c203d4ce7c9464e12c8fb1bce (diff) | |
download | ruby-d3c072dfe70706842afd861ba2f4f866f3469a38.tar.gz ruby-d3c072dfe70706842afd861ba2f4f866f3469a38.tar.xz ruby-d3c072dfe70706842afd861ba2f4f866f3469a38.zip |
* lib/ostruct.rb (OpenStruct#initialize_copy): should not share
members. [ruby-dev:22966]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ostruct.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb index 786bd4de2..b0bb77526 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 |