From: E S Date: 2005-01-30T09:48:47+09:00 Subject: Re: methods/constants/classes available in context 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 See ruby-doc for details on their usage and other methods. > Regards, > Jeff Davis E