Top Level Namespace
Defined Under Namespace
Modules: Instrument
Instance Method Summary collapse
-
#instrument(*raw_targets, &handler) ⇒ Object
call-seq: instrument(“ClassName#instance_method”, …) { |instance, time, *args| … } instrument(“ClassName::class_method”, …) { |klass, time, *args| … } instrument(“ClassName.class_method”, …) { |klass, time, *args| … }.
Instance Method Details
#instrument(*raw_targets, &handler) ⇒ Object
call-seq:
instrument("ClassName#instance_method", ...) { |instance, time, *args| ... }
instrument("ClassName::class_method", ...) { |klass, time, *args| ... }
instrument("ClassName.class_method", ...) { |klass, time, *args| ... }
Add a handler to be called every time a method is invoked
10 11 12 |
# File 'lib/instrument.rb', line 10 def instrument(*raw_targets, &handler) Instrument.add(*raw_targets, &handler) end |