mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/delegate.rb (SimpleDelegator::dup): removed needless argument.
[ruby-list:44910] * lib/delegate.rb (clone, dup): keep relationship with the target object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f55e8e89cb
commit
41f89359bb
2 changed files with 21 additions and 9 deletions
|
@ -1,3 +1,11 @@
|
|||
Mon May 12 10:41:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/delegate.rb (SimpleDelegator::dup): removed needless argument.
|
||||
[ruby-list:44910]
|
||||
|
||||
* lib/delegate.rb (clone, dup): keep relationship with the target
|
||||
object.
|
||||
|
||||
Sun May 11 23:19:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* enum.c (all_iter_i, any_iter_i): reduced duplicated code.
|
||||
|
|
|
@ -227,13 +227,15 @@ class SimpleDelegator<Delegator
|
|||
|
||||
# Clone support for the object returned by \_\_getobj\_\_.
|
||||
def clone
|
||||
super
|
||||
__setobj__(__getobj__.clone)
|
||||
new = super
|
||||
new.__setobj__(__getobj__.clone)
|
||||
new
|
||||
end
|
||||
# Duplication support for the object returned by \_\_getobj\_\_.
|
||||
def dup(obj)
|
||||
super
|
||||
__setobj__(__getobj__.dup)
|
||||
def dup
|
||||
new = super
|
||||
new.__setobj__(__getobj__.clone)
|
||||
new
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -280,12 +282,14 @@ def DelegateClass(superclass)
|
|||
@_dc_obj = obj
|
||||
end
|
||||
def clone # :nodoc:
|
||||
super
|
||||
__setobj__(__getobj__.clone)
|
||||
new = super
|
||||
new.__setobj__(__getobj__.clone)
|
||||
new
|
||||
end
|
||||
def dup # :nodoc:
|
||||
super
|
||||
__setobj__(__getobj__.dup)
|
||||
new = super
|
||||
new.__setobj__(__getobj__.clone)
|
||||
new
|
||||
end
|
||||
}
|
||||
for method in methods
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue