1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/delegate.rb (Delegator#initialize_copy): use initialize_copy

instead of overriding clone/dup.  [ruby-dev:40221]
  it now always clones the target, it might cause incompatibility.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2010-01-28 16:47:21 +00:00
parent d1499525d5
commit d9e84f2327
2 changed files with 9 additions and 11 deletions

View file

@ -1,3 +1,9 @@
Fri Jan 29 01:42:24 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb (Delegator#initialize_copy): use initialize_copy
instead of overriding clone/dup. [ruby-dev:40221]
it now always clones the target, it might cause incompatibility.
Fri Jan 29 01:26:53 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/bigdecimal/bigdecimal.c (BigDecimal_to_i): update RDoc to

View file

@ -201,17 +201,9 @@ class Delegator
end
end
# Clone support for the object returned by \_\_getobj\_\_.
def clone
new = super
new.__setobj__(__getobj__.clone)
new
end
# Duplication support for the object returned by \_\_getobj\_\_.
def dup
new = super
new.__setobj__(__getobj__.dup)
new
# clone/dup support for the object returned by \_\_getobj\_\_.
def initialize_copy(other)
self.__setobj__(other.__getobj__.clone)
end
# Freeze self and target at once.