Ruby can tell you the methods: obj.methods (there's also #public_methods, #instance_methods, #private_methods, etc.). Ruby can
tell you the instance variables (#instance_variables).
Ruby can't tell you the documentation; there's no docstring like there
is in Python. There are some enhancements to irb available that give
an ri command from within irb.
Actually, irb can give you documentation. For example :
irb(main):001:0> help Array
It works like ri.
···
Le vendredi 23 mars 2007 14:54, Austin Ziegler a écrit :
Ruby can tell you the methods: obj.methods (there's also #public_methods, #instance_methods, #private_methods, etc.). Ruby can
tell you the instance variables (#instance_variables).
Ruby can't tell you the documentation; there's no docstring like there
is in Python. There are some enhancements to irb available that give
an ri command from within irb.
Ruby can tell you the methods: obj.methods (there's also #public_methods, #instance_methods, #private_methods, etc.). Ruby can
tell you the instance variables (#instance_variables).
you can also use local_variables to get a list of... local variables!