Class: String

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

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}"   end

#cyanObject



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

def cyan;   "#{CYAN}#{self}#{NC}"   end

#grayObject



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

def gray;   "#{GRAY}#{self}#{NC}"   end

#greenObject



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

def green;  "#{GREEN}#{self}#{NC}"  end

#redObject



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

def red;    "#{RED}#{self}#{NC}"    end

#sanitize_coloredObject



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

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

#yellowObject



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

def yellow; "#{YELLOW}#{self}#{NC}" end