Class: Object

Inherits:
BasicObject
Defined in:
lib/pretty_debug.rb

Instance Method Summary collapse

Instance Method Details

#expandObject



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

def expand; inspect.verbatim end

#intercept(&pr) ⇒ Object



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

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.unchomp.verbatim
  end
end

#verbatimObject



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

def verbatim
  bg(:magenta)
end