aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ostruct.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-20 10:11:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-20 10:11:25 +0000
commit33e064affff29ac2a59dbc4d6a9e47b26da39080 (patch)
tree07a9cd7942d325708726e9ae4446c1781396f4b4 /lib/ostruct.rb
parent50b775851ad4cdae41b05bd133683f8894500674 (diff)
downloadruby-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
Diffstat (limited to 'lib/ostruct.rb')
-rw-r--r--lib/ostruct.rb6
1 files changed, 6 insertions, 0 deletions
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