class Object
Public Instance Methods
pd(thing = nil, options = {})
click to toggle source
# File lib/pd_ruby/helper_methods.rb, line 19 def pd(thing = nil, options = {}) options[:backtrace_offset] ||= 1 print_debug(thing, **options) end
print_debug(thing = nil, backtrace_offset: 0, **keywords)
click to toggle source
# File lib/pd_ruby/helper_methods.rb, line 3 def print_debug(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) color = PDRuby.color_for(backtrace_line) puts( ( 'PD: ' + thing ).colorize(color) + ' @ ' + backtrace_line.to_s.colorize(color) ) puts "\n" thing end