Class: Object

Inherits:
BasicObject
Defined in:
lib/pretty_debug.rb

Instance Method Summary collapse

Instance Method Details

#interceptObject



27
28
29
30
31
32
# File 'lib/pretty_debug.rb', line 27

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

#which(m) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/pretty_debug.rb', line 33

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