In Ruby, How to know if a method is available to an object?