lib/banana/logger.rb
# Calls the block after changing the output method.
# It also ensures to set back the method to what it was before.
#
# @param [Symbol] method Method to call on {#channel}
Calls the block after changing the output method.
It also ensures to set back the method to what it was before.
Calls the block after changing the output method . It also ensures to set back the method to what it was before .
def ensure_method method, &block
      old_method, old_logged = @method, @logged
      @method, @logged = method, 0
      block.call
    ensure
      @method = old_method
      @logged += old_logged
    end
def ensure_method method , & block old_method , old_logged = @method , @logged @method , @logged = method , 0 block . call ensure @method = old_method @logged += old_logged end
Calls the block after changing the output method.
Calls the block after changing the output method .
method
<not_specific>
block
<not_specific>
<not_specific>
method Method to call on {#channel}
method Method to call on { #channel }