From: Joel VanderWerf Date: 2003-03-25T10:11:22+09:00 Subject: Re: exiting a loop Daniel Carrera wrote: > On Mon, Mar 24, 2003 at 04:16:24PM +0900, ahoward wrote: > > >>i end up doing something like this too, only i usually use : >> >>ruby -e 'puts SomeClass.new.methods.sort - Object.new.methods.sort' | less >> >>to weed out all but the unique ones. > > > I didn't think of that. I just wrote this one-line script: > ---------- > #!/bin/sh > # File name: methods > > ruby -e 'puts '$1'.new.methods.sort - Object.new.methods.sort' | less > ---------- > > So I can just type "methods String" on a terminal. > Nice. More focused than 'ri String'. It might be better to use Module#instance_methods. It takes a boolean arg that determines if superclasses are included, but you might still want to do the subtraction. What this would save you is actually instantiating an object, which might fail for lack of arguments, and anyway who knows what instantiating the class does (fork a web server maybe?).