summaryrefslogtreecommitdiffstats
path: root/lib/delegate.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-19 19:17:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-19 19:17:33 +0000
commit4f15838a101918553f093c46a418e0d4a2d0f041 (patch)
tree38e816c1ccabb276324a5ae54ec8b58941bbf6fb /lib/delegate.rb
parent27b4a4274e45132c73b5779fd94c33c9773afc9e (diff)
downloadruby-4f15838a101918553f093c46a418e0d4a2d0f041.tar.gz
ruby-4f15838a101918553f093c46a418e0d4a2d0f041.tar.xz
ruby-4f15838a101918553f093c46a418e0d4a2d0f041.zip
* array.c (rb_ary_times): Array#* should return an instance of
the class of right operand. [ruby-dev:24526] * ext/zlib/zlib.c (zstream_detach_buffer): should not expose class-less object to Ruby world. [ruby-dev:24530] * eval.c (proc_dup): provide Proc#dup as well. [ruby-talk:116915] * eval.c (ruby_exec): stack marking position may be higher than expected. thanks to Guy Decoux. [ruby-core:03527] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/delegate.rb')
-rw-r--r--lib/delegate.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/delegate.rb b/lib/delegate.rb
index c6f8f5d94..10b135116 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -76,10 +76,14 @@ class SimpleDelegator<Delegator
@_sd_obj = obj
end
- def initialize_copy(obj)
+ def clone(obj)
super
__setobj__(obj.__getobj__.clone)
end
+ def dup(obj)
+ super
+ __setobj__(obj.__getobj__.dup)
+ end
end
# backward compatibility ^_^;;;
@@ -108,9 +112,13 @@ def DelegateClass(superclass)
def __setobj__(obj)
@_dc_obj = obj
end
- def initialize_copy(obj)
+ def clone(obj)
super
- __setobj__(obj.__getobj__.clone)
+ __setobj__(obj.__getobj__.clone)
+ end
+ def dup(obj)
+ super
+ __setobj__(obj.__getobj__.dup)
end
}
for method in methods