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.
Le vendredi 23 mars 2007 14:54, Austin Z. 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.
-austin
Actually, irb can give you documentation. For example :
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!
Daniel
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.