Top Level Namespace
Defined Under Namespace
Modules: SimplySerializable
Instance Method Summary collapse
-
#pdb(thing = nil, backtrace_offset: 0, **keywords) ⇒ Object
TODO: Remove if we don’t want this in production?.
Instance Method Details
#pdb(thing = nil, backtrace_offset: 0, **keywords) ⇒ Object
TODO: Remove if we don’t want this in production?
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/simply_serializable/debug.rb', line 2 def pdb(thing = nil, backtrace_offset: 0, **keywords) backtrace_line = caller[backtrace_offset].split(':')[0..1].join(':') thing = keywords if thing.eql?(nil) && keywords.any? thing = thing.inspect unless thing.is_a?(String) puts( ( 'PDB' + ': ' + thing ).colorize(color: :black, background: :light_white) + " @ #{backtrace_line}".colorize(color: :blue, background: :light_white) ) puts "\n" thing end |