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
129 130 131 |
# File 'lib/takeltau/info/status/bar.rb', line 129 def blue colorize(34) end |
#colorize(color_code) ⇒ Object
Colorize strings
109 110 111 |
# File 'lib/takeltau/info/status/bar.rb', line 109 def colorize(color_code) "\e[#{color_code}m#{self}\e[0m" end |
#green ⇒ Object
String color green
119 120 121 |
# File 'lib/takeltau/info/status/bar.rb', line 119 def green colorize(32) end |
#light_blue ⇒ Object
String color light_blue
139 140 141 |
# File 'lib/takeltau/info/status/bar.rb', line 139 def light_blue colorize(36) end |
#pink ⇒ Object
String color pink
134 135 136 |
# File 'lib/takeltau/info/status/bar.rb', line 134 def pink colorize(35) end |
#red ⇒ Object
String color red
114 115 116 |
# File 'lib/takeltau/info/status/bar.rb', line 114 def red colorize(31) end |
#yellow ⇒ Object
String color yellow
124 125 126 |
# File 'lib/takeltau/info/status/bar.rb', line 124 def yellow colorize(33) end |