Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/pp-stats/format.rb
Instance Method Summary collapse
- #blue ⇒ Object
- #colorize(color_code) ⇒ Object
- #cyan ⇒ Object
- #gray ⇒ Object
- #green ⇒ Object
- #magenta ⇒ Object
- #red ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#blue ⇒ Object
53 54 55 |
# File 'lib/pp-stats/format.rb', line 53 def blue colorize(34) end |
#colorize(color_code) ⇒ Object
37 38 39 |
# File 'lib/pp-stats/format.rb', line 37 def colorize(color_code) "\e[#{color_code}m#{self}\e[0m" end |
#cyan ⇒ Object
61 62 63 |
# File 'lib/pp-stats/format.rb', line 61 def cyan colorize(36) end |
#gray ⇒ Object
65 66 67 |
# File 'lib/pp-stats/format.rb', line 65 def gray colorize(37) end |
#green ⇒ Object
45 46 47 |
# File 'lib/pp-stats/format.rb', line 45 def green colorize(32) end |
#magenta ⇒ Object
57 58 59 |
# File 'lib/pp-stats/format.rb', line 57 def magenta colorize(35) end |
#red ⇒ Object
41 42 43 |
# File 'lib/pp-stats/format.rb', line 41 def red colorize(31) end |
#yellow ⇒ Object
49 50 51 |
# File 'lib/pp-stats/format.rb', line 49 def yellow colorize(33) end |