summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/delegate.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/delegate.rb b/lib/delegate.rb
index a4bbe0615c3..c73a3bd8a02 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -13,12 +13,12 @@
class Delegator
def initialize(obj)
+ preserved = ::Kernel.instance_methods
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", "==", "=~"]
+ preserved -= ["__getobj__","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"