For learning purposes, I want to display a list of methods available.
How would I do that?
For example, I found out I can do this…
debug @user.errors.full_messages
debug @user.errors.count
How can I find what other methods are available to call on errors or any
other object?
leonel
July 26, 2011, 8:37pm
2
On Jul 26, 2011, at 11:17 AM, Leonel . wrote:
For learning purposes, I want to display a list of methods available.
How would I do that?
For example, I found out I can do this…
debug @user.errors.full_messages
debug @user.errors.count
How can I find what other methods are available to call on errors or any
other object?
puts @user.methods.sort.join ("\n")
puts @user.errors.methods.sort.join ("\n")
etc…
would give you a nice ordered list. This will include methods in parent
classes. There are ways to limit it to just this class… see the docs
for more info.
-philip