That throws an error because self here refers to the class itself, not an instance of the class, and the class does not respond to that method. You could try [`method_defined?`](http://www.ruby-doc.org/core-2.1.0/Module.html#method-i-method_defined-3F).