Class: Object

Inherits:
BasicObject
Defined in:
lib/pretty_debug.rb

Instance Method Summary collapse

Instance Method Details

#expandObject



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

def expand; inspect.verbatim end

#intercept(&pr) ⇒ Object



209
210
211
212
213
214
# File 'lib/pretty_debug.rb', line 209

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



216
217
218
# File 'lib/pretty_debug.rb', line 216

def verbatim
  bg(:magenta)
end