Hi !

The Object#respond_to? method has a second boolean flag that tells
if private methods should be included in the search or not.

I think the default value of that parameter is a bit unintuitive.
Wouldn't it be better if the default was depending on the call
context ?, ie. that

    ......respond_to? :foo......

told if

    ......foo(arguments)......

would succeed in finding a callable function/method.

With the current behaviour, I have to be aware of for example that
top-level-functions are implemented as private methods of Object
(or is it Kernel ???).

My example above includes that I think it would be nice if
respond_to? was sensitive to if it was called with/without an
explicit object reference inside an object method.

Thoughts ?

/Johan Holmberg