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>
|
Sun May 11 23:19:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* enum.c (all_iter_i, any_iter_i): reduced duplicated code.
|
* 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\_\_.
|
# Clone support for the object returned by \_\_getobj\_\_.
|
||||||
def clone
|
def clone
|
||||||
super
|
new = super
|
||||||
__setobj__(__getobj__.clone)
|
new.__setobj__(__getobj__.clone)
|
||||||
|
new
|
||||||
end
|
end
|
||||||
# Duplication support for the object returned by \_\_getobj\_\_.
|
# Duplication support for the object returned by \_\_getobj\_\_.
|
||||||
def dup(obj)
|
def dup
|
||||||
super
|
new = super
|
||||||
__setobj__(__getobj__.dup)
|
new.__setobj__(__getobj__.clone)
|
||||||
|
new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -280,12 +282,14 @@ def DelegateClass(superclass)
|
||||||
@_dc_obj = obj
|
@_dc_obj = obj
|
||||||
end
|
end
|
||||||
def clone # :nodoc:
|
def clone # :nodoc:
|
||||||
super
|
new = super
|
||||||
__setobj__(__getobj__.clone)
|
new.__setobj__(__getobj__.clone)
|
||||||
|
new
|
||||||
end
|
end
|
||||||
def dup # :nodoc:
|
def dup # :nodoc:
|
||||||
super
|
new = super
|
||||||
__setobj__(__getobj__.dup)
|
new.__setobj__(__getobj__.clone)
|
||||||
|
new
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
for method in methods
|
for method in methods
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue