Class: String

Inherits:
Object show all
Defined in:
lib/pretty_debug.rb,
lib/pretty_debug.rb

Instance Method Summary collapse

Instance Method Details

#bfObject



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

def bf; "#{vt100("01")}#{self}#{vt100}" end

#bg(sym) ⇒ Object



115
116
117
# File 'lib/pretty_debug.rb', line 115

def bg sym; "#{vt100(40+
{black: 0, red: 1, green: 2, yellow: 3, blue: 4, magenta: 5, cyan: 6, white: 7}[sym]
)}#{self}#{vt100}" end

#color(sym) ⇒ Object



112
113
114
# File 'lib/pretty_debug.rb', line 112

def color sym; "#{vt100(30+
{black: 0, red: 1, green: 2, yellow: 3, blue: 4, magenta: 5, cyan: 6, white: 7}[sym]
)}#{self}#{vt100}" end

#parse_ltsvObject



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

def parse_ltsv; Hash[chomp.split("\t").map{|f| f.split(":", 2)}] end

#terminal_escapeObject



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

def terminal_escape; "\"#{self}\"" end