I know that I can capture the moment the method is defined with set_trace_func .
set_trace_func ->event, file, line, method, binding, klass{ if event == "c-call" and method == :method_added
- Is it possible to write the name of the method defined at this moment? I know that a class can be captured by
eval("self", binding) . What code can be placed inside the above block to capture the method name? - Is it possible to get the format of the arguments for the method being defined (the required arguments, the remaining arguments and their names as they are in the source)?
source share