Class: String
- Inherits:
-
Object
- Object
- String
- 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
- #blue ⇒ Object
- #cyan ⇒ Object
- #gray ⇒ Object
- #green ⇒ Object
- #red ⇒ Object
- #sanitize_colored ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#blue ⇒ Object
17 |
# File 'lib/string.rb', line 17 def blue = "#{BLUE}#{self}#{NC}" |
#cyan ⇒ Object
18 |
# File 'lib/string.rb', line 18 def cyan = "#{CYAN}#{self}#{NC}" |
#gray ⇒ Object
13 |
# File 'lib/string.rb', line 13 def gray = "#{GRAY}#{self}#{NC}" |
#green ⇒ Object
15 |
# File 'lib/string.rb', line 15 def green = "#{GREEN}#{self}#{NC}" |
#red ⇒ Object
14 |
# File 'lib/string.rb', line 14 def red = "#{RED}#{self}#{NC}" |
#sanitize_colored ⇒ Object
20 |
# File 'lib/string.rb', line 20 def sanitize_colored = gsub(/\e\[\d+;?\d*m/, "") |
#yellow ⇒ Object
16 |
# File 'lib/string.rb', line 16 def yellow = "#{YELLOW}#{self}#{NC}" |