to_s() public

Returns a human-readable description of the underlying method.

"cat".method(:count).inspect   #=> "#<Method: String#count>"
(1..3).method(:map).inspect    #=> "#<Method: Range(Enumerable)#map>"

In the latter case, the method description includes the “owner” of the original method (Enumerable module, which is included into Range).

Show source
Register or log in to add new notes.