summaryrefslogtreecommitdiff
path: root/lib/delegate.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/delegate.rb')
-rw-r--r--lib/delegate.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/delegate.rb b/lib/delegate.rb
index 97467cd4354..ca1f0282681 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -57,6 +57,11 @@ class Delegator
target.__send__(m, *args)
end
+ def respond_to?(m)
+ return true if super
+ return self.__getobj__.respond_to?(m)
+ end
+
def __getobj__
raise NotImplementedError, "need to define `__getobj__'"
end
@@ -115,6 +120,10 @@ def DelegateClass(superclass)
end
@_dc_obj.__send__(m, *args)
end
+ def respond_to?(m)
+ return true if super
+ return @_dc_obj.respond_to?(m)
+ end
def __getobj__
@_dc_obj
end