Tuesday, 3 September 2013

Ruby - Display the source of a method

Ruby - Display the source of a method

I would like to display the source of a Ruby method that has already been
defined by calling, for instance source myMethod(args), which would then
output the content of the method as a String. I would like to be able to
do that without using any external gem. this question has been asked many
times, however all the answers advise to use external gems such as Pry,
Sourcify, etc.

No comments:

Post a Comment