From: Jeff Davis Date: 2005-01-30T11:08:49+09:00 Subject: Re: methods/constants/classes available in context E S wrote: >Jeff Davis wrote: > > > >>I am learning Ruby and one thing I sometimes find difficult is knowing >>what methods, constants, and classes are available in a given context. >> >>One example was I required a module, but I didn't know everything that >>the module contained. Is there a way to know everything that you can >>call in a given context? All the symbols that are available? >> >> > >If you want to know what a unit contains, www.ruby-doc.org is a good >resource (or you can use ri, or line completion in irb). If you want >your *code* to know what's available, try these: > >Object#instance_variables >Object#private_methods >Object#protected_methods >Object#public_methods >Object#singleton_methods >Module#constants >Module#instance_methods >Module#private_instance_methods >Module#protected_instance_methods >Module#public_instance_methods >Kernel#global_variables >Kernel#local_variables > > > > Thanks, that's exactly what I was looking for. And thanks for the help on the other question also. Regards, Jeff Davis