From: "Einar Magnús Boson" Date: 2008-12-17T15:04:00+09:00 Subject: Re: function discovery f.methods f.methods(false) to skip the inherited ones. usually this is helpful: puts f.methods(false).sort On 17.12.2008, at 05:36 , Joshua Ball wrote: > I am curious if there is a programatic way to list all methods of a > class. > (Yes, I know about "ri", I am just curious here) > > For instance, I am trying to figure out what I could do with the > File f in: > open(ARGV[0], 'rb') { |f| > puts f.stat.mtime > puts f.class > } > > Now, f.class returns: File > > Is there anything like: > f.functions.each { |p| puts p } > > Thanks einarmagnus