Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/tonka.rb
Instance Method Summary collapse
-
#colorize(color_code) ⇒ Object
text colorization.
- #green ⇒ Object
- #pink ⇒ Object
- #red ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#colorize(color_code) ⇒ Object
text colorization
295 296 297 |
# File 'lib/tonka.rb', line 295 def colorize(color_code) "\e[#{color_code}m#{self}\e[0m" end |
#green ⇒ Object
303 304 305 |
# File 'lib/tonka.rb', line 303 def green colorize(32) end |
#pink ⇒ Object
311 312 313 |
# File 'lib/tonka.rb', line 311 def pink colorize(35) end |
#red ⇒ Object
299 300 301 |
# File 'lib/tonka.rb', line 299 def red colorize(31) end |
#yellow ⇒ Object
307 308 309 |
# File 'lib/tonka.rb', line 307 def yellow colorize(33) end |