* lib/delegate.rb (Delegator): simplified and restored 1.8

behavior.  [ruby-dev:35986]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-10-14 14:21:25 +00:00
Родитель 4dbc8e2454
Коммит f9c35bce1b
2 изменённых файлов: 6 добавлений и 13 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Oct 14 23:18:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb (Delegator): simplified and restored 1.8
behavior. [ruby-dev:35986]
Tue Oct 14 21:50:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (TESTS): skips minitest by default, since it interferes

Просмотреть файл

@ -115,12 +115,7 @@
# implementation, see SimpleDelegator.
#
class Delegator
preserved = [
:__id__, :object_id, :__send__, :public_send, :respond_to?, :send,
:instance_eval, :instance_exec, :extend,
]
instance_methods.each do |m|
next if preserved.include?(m)
[:to_s,:inspect,:=~,:!~,:===].each do |m|
undef_method m
end
@ -165,13 +160,6 @@ class Delegator
self.__getobj__ == obj
end
#
# Returns true only if two objects are identical.
#
def equal?(obj)
self.object_id == obj.object_id
end
#
# This method must be overridden by subclasses and should return the object
# method calls are being delegated to.