Actions
Bug #2206
closedlib/delegate: inconsistency between respond_to? and send
Description
=begin
require 'delegate'
class A
private
def private_method
:bar
end
end
x = SimpleDelegator.new(A.new)
x.respond_to?(:private_method, true) # ==> true
x.send(:private_method) # ==> NoMethodError
I expected the call to private_method to be delegated. The attached patch fixes the problem. It is not very elegant but I couldn't think of anything better.
=end
Files
Actions
Like0
Like0Like0