Hacker News new | ask | show | jobs
by Linell 946 days ago
Another pro-tip in this vein is `object.methods` to see a list of the methods to which the object you're messing with will respond. I use this all of the time when I'm diving into something trying to figure out what's going on.
1 comments

I always do object.methods.sort, otherwise my brain can't consume it
I use `my_object.methods.sort - Object.methods` to help reduce the methods I need to consider.
Subtracting Object.new.methods will remove more of the standard methods than Object.methods.
Even better, thank you!