method
respond_to?
respond_to?(p1, p2 = v2)
public
Returns true if obj responds to the given method. Private methods are included in the search only if the optional second parameter evaluates to true.
If the method is not implemented, as Process.fork on Windows, File.lchmod on GNU/Linux, etc., false is returned.
If the method is not defined, respond_to_missing? method is called and the result is returned.