lib/trace_spy/method.rb
# Allows to run a block of code in the context of a tracer with the
# convenient side-effect of not having to remember to turn it off
# afterwards.
#
# Tracer will only be active within the block, and will be disabled
# afterwards
#
# @since 0.0.3
#
# @example
#   The tracer will only be active within the block:
#
#   ```ruby
#   tracer.with_tracing do
#     # tasks
#   end
#   ```
#
# @param &traced_function [Proc]
#   Function to execute with tracing enabled
#
# @return [TrueClass]
#   Result of disabling the tracer
Allows to run a block of code in the context of a tracer with the
convenient side-effect of not having to remember to turn it off
afterwards.

Tracer will only be active within the block, and will be disabled
afterwards
Allows to run a block of code in the context of a tracer with the convenient side - effect of not having to remember to turn it off afterwards . Tracer will only be active within the block and will be disabled afterwards
def with_tracing(&traced_function)
      self.enable
      yield
      self.disable
    end
def with_tracing ( & traced_function ) self . enable yield self . disable end
Allows to run a block of code in the context of a tracer with the
convenient side-effect of not having to remember to turn it off
afterwards.
Allows to run a block of code in the context of a tracer with the convenient side - effect of not having to remember to turn it off afterwards .
Result of disabling the tracer
Result of disabling the tracer
TrueClass
traced_function
&traced_function
Function to execute with tracing enabled
Function to execute with tracing enabled
since
None
example
The tracer will only be active within the block: ```ruby tracer.with_tracing do # tasks end ```
The tracer will only be active within the block : ` ` ` ruby tracer . with_tracing do # tasks end ` ` `