57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/method/tracer.rb', line 57
def trace_method(*methods)
methods.each do |method_name|
method_name_without_instrumentation = "#{method_name}_without_instrumentation".to_sym
class_name = guess_class_name
class_eval do
alias_method method_name_without_instrumentation, method_name
define_method(method_name) do |*args, &block|
::Method::Tracer.trace_method(class_name, method_name) do
send(method_name_without_instrumentation, *args, &block)
end
end
end
end
end
|