Module: DebugLogging::Finalize

Defined in:
lib/debug_logging/finalize.rb

Class Method Summary collapse

Class Method Details

.extended(obj) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/debug_logging/finalize.rb', line 5

def self.extended(obj)
  TracePoint.trace(:end) do |t|
    if obj == t.self
      if obj.respond_to?(:debug_finalize)
        obj.debug_finalize
      else
        warn("#{obj} does not define a debug_finalize")
      end
      t.disable
    end
  end
end