George Ogata wrote:
> On 11/30/06, Trans <transfire / gmail.com> wrote:
> > I had a hard enough time recalling that #instance_methods only returns
> > public methods rather then all methods,   and after all this time I'm
> > only now discovering that #methods(false) only returns singleton
> > methods? Why? Has it changed? Am I loosing my mind?
>
> It hasn't changed recently:
>
> Tue May  6 14:39:36 2003  Yukihiro Matsumoto  <matz / ruby-lang.org>
>
>         * object.c (rb_obj_methods): list singleton methods if recur
>           argument is false;  list all methods otherwise.

Thanks. I suppose matz has his reasons. Though I can't say I quite
phatom them. Even his changelog entry isn;t exactly corrent since only
_public_ singleton methods show up if argument is false; and list all
_public_ methods otherwise.

I have to agree with David Black that this true false parameter has no
sematic quality. That is differs in result from obj.methods to
class.methods is further confusing on top of the distinctions between
methods, public_methods,  etc. This was brought up a long time ago, but
I still agress with the idea of a sinlge interface that takes symbolic
"filters".

  obj.methods(:singleton)
  obj.methods(:public)
  obj.methods(:all)
  obj.methods(:private, :public)  # combination

etc.

> > The ri doumentation fails even to metion the parameter.

> You're right.  I reckon a documentation patch would be well-appreciated... ;-)

Hehe. Well, that's going to have be left up to one of our doc
specialists. I already have enough cod eof my own that need
documenting. :-)

T.