Class: Object

Inherits:
BasicObject
Defined in:
lib/pretty_debug.rb

Instance Method Summary collapse

Instance Method Details

#interceptObject



31
32
33
34
35
36
# File 'lib/pretty_debug.rb', line 31

def intercept; self ensure
  l = caller_location
  puts \
    "[Debug] #{"#{l.realpath}:#{l.lineno}"}".bf.color(:yellow),
    inspect.verbatim
end

#which(m) ⇒ Object



37
38
39
40
41
42
43
44
# File 'lib/pretty_debug.rb', line 37

def which m; self ensure
  l = caller_location
  m = :method_missing unless self.class.method_defined?(m)
  mt = method(m)
  puts \
    "[Debug] #{"#{l.realpath}:#{l.lineno}"}".bf.color(:yellow),
    "#{self.class}(#{mt.owner})##{m}@#{mt.source_location.to_a.join(":".freeze)}"
end