From: James Edward Gray II Date: 2006-03-30T00:36:42+09:00 Subject: Re: Ruby Black Belt On Mar 29, 2006, at 8:50 AM, ts wrote: >>>>>> "J" == James Edward Gray writes: > > J> Robert Dober was kind enough to point out that RDoc may have led me > J> astray here. You can call Kernel methods like class methods and > they > J> do not show up in the list of instance_methods(). They are mixed > J> into Object though, right? Can someone clue me in here? > > a global function is a Kernel module function : this mean that it's a > *private* method (this is why #instance_methods don't display it) > and a > public singleton method > > moulon% ruby -e 'module M def f() end; module_function :f end; p > M.instance_methods' > [] > moulon% > > moulon% ruby -e 'module M def f() end; module_function :f end; p > M.private_instance_methods' > ["f"] > moulon% > > moulon% ruby -e 'module M def f() end; module_function :f end; p > M.singleton_methods' > ["f"] > moulon% Thanks for the lesson Guy. Insightful as always. James Edward Gray II