respond_to?

Check if a method was defined by the object

object.respond_to?(:not_sure_method)
#=> true/false

object.respond_to?(:not_sure_method, true)
#=> true/false, private methods included

Reference

results matching ""

    No results matching ""