Project

General

Profile

Actions

Bug #2206

closed

lib/delegate: inconsistency between respond_to? and send

Added by marcandre (Marc-Andre Lafortune) about 15 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2dev (2009-10-13 trunk 25317) [x86_64-darwin10.0.0]
Backport:
[ruby-core:26080]

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

delegate_send.diff (1007 Bytes) delegate_send.diff marcandre (Marc-Andre Lafortune), 10/14/2009 01:06 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0