Class: Object

Inherits:
BasicObject
Defined in:
lib/pretty_debug.rb

Instance Method Summary collapse

Instance Method Details

#expandObject



247
# File 'lib/pretty_debug.rb', line 247

def expand; inspect.verbatim end

#intercept(&pr) ⇒ Object



241
242
243
244
245
246
# File 'lib/pretty_debug.rb', line 241

def intercept &pr
  tap do |x| puts \
    "[Debug] #{caller_location(3).chain{|l| "#{l.path}:#{l.lineno}"}}".color(:yellow),
    (pr ? pr.call(x) : x).inspect.verbatim.unchomp
  end
end