Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/takeltau/info/status/bar.rb
Overview
Amend String class with colorization.
Instance Method Summary collapse
-
#blue ⇒ Object
String color blue.
-
#colorize(color_code) ⇒ Object
Colorize strings.
-
#green ⇒ Object
String color green.
-
#light_blue ⇒ Object
String color light_blue.
-
#pink ⇒ Object
String color pink.
-
#red ⇒ Object
String color red.
-
#yellow ⇒ Object
String color yellow.
Instance Method Details
#blue ⇒ Object
String color blue
127 128 129 |
# File 'lib/takeltau/info/status/bar.rb', line 127 def blue colorize(34) end |
#colorize(color_code) ⇒ Object
Colorize strings
107 108 109 |
# File 'lib/takeltau/info/status/bar.rb', line 107 def colorize(color_code) "\e[#{color_code}m#{self}\e[0m" end |
#green ⇒ Object
String color green
117 118 119 |
# File 'lib/takeltau/info/status/bar.rb', line 117 def green colorize(32) end |
#light_blue ⇒ Object
String color light_blue
137 138 139 |
# File 'lib/takeltau/info/status/bar.rb', line 137 def light_blue colorize(36) end |
#pink ⇒ Object
String color pink
132 133 134 |
# File 'lib/takeltau/info/status/bar.rb', line 132 def pink colorize(35) end |
#red ⇒ Object
String color red
112 113 114 |
# File 'lib/takeltau/info/status/bar.rb', line 112 def red colorize(31) end |
#yellow ⇒ Object
String color yellow
122 123 124 |
# File 'lib/takeltau/info/status/bar.rb', line 122 def yellow colorize(33) end |