Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/string.rb

Overview

extension for strings

Constant Summary collapse

NC =
"\e[0m"
GRAY =
"\e[1;30m"
RED =
"\e[1;31m"
GREEN =
"\e[1;32m"
YELLOW =
"\e[1;33m"
BLUE =
"\e[1;34m"
CYAN =
"\e[1;36m"

Instance Method Summary collapse

Instance Method Details

#blueObject



17
# File 'lib/string.rb', line 17

def blue   = "#{BLUE}#{self}#{NC}"

#cyanObject



18
# File 'lib/string.rb', line 18

def cyan   = "#{CYAN}#{self}#{NC}"

#grayObject



13
# File 'lib/string.rb', line 13

def gray   = "#{GRAY}#{self}#{NC}"

#greenObject



15
# File 'lib/string.rb', line 15

def green  = "#{GREEN}#{self}#{NC}"

#redObject



14
# File 'lib/string.rb', line 14

def red    = "#{RED}#{self}#{NC}"

#sanitize_coloredObject



20
# File 'lib/string.rb', line 20

def sanitize_colored = gsub(/\e\[\d+;?\d*m/, "")

#yellowObject



16
# File 'lib/string.rb', line 16

def yellow = "#{YELLOW}#{self}#{NC}"