summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-07 08:41:26 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-07 08:41:26 +0000
commit14b9d586fa1fabb695f06c5b9c1d0785207d77ef (patch)
tree7dbbcd3b404423b4148864ec8232c17da601bcf4 /lib
parentba06b1a81f81e089849c7c877eba7b1d3618b126 (diff)
1.1b9_07
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/delegate.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/delegate.rb b/lib/delegate.rb
index 205d5e1..a544773 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -13,11 +13,12 @@
class Delegator
def initialize(obj)
- preserved = ["type", "id", "equal?", "__getobj__"]
for t in self.type.ancestors
preserved |= t.instance_methods
break if t == Delegator
end
+ preserved |= ::Kernel.instance_methods
+ preserved -= ["to_s", "nil?", "to_a", "hash", "dup", "==", "=~"]
for method in obj.methods
next if preserved.include? method
eval "def self.#{method}(*args,&block); __getobj__.__send__(:#{method}, *args,&block); end"