From: Siep Korteling Date: 2008-09-23T18:23:48+09:00 Subject: Re: Returning the names of each defined method Kain Nobel wrote: > Good day everybody! > > I was curious, for code that isn't veiwable, how would I print each > defined method in a class/module? For instance... lets say that File > happened to be a hidden class, how could I make the interpreter p or > print each method that is defined in class File? p File.methods #or puts File.methods.sort # you can't use all these methods, some of them are private. To exclude these: puts File.public_methods.sort # Works on instances, too. puts "somestring".public_methods.sort hth, Siep -- Posted via http://www.ruby-forum.com/.