3 ms·
You could even do away with is_a? there and just ask if the argument responds_to a particular method and then call the method if it does. I find myself doing mo
by aeden 16y ago
You could even do away with is_a? there and just ask if the argument responds_to a particular method and then call the method if it does. I find myself doing more of this and less of calls to is_a? these days.
- steveklabnik 16y agoIt's conceptually much cleaner, too. If you're asking about the type of something, you're almost always just trying to see if it has some method. Just ask about the method response directly.