Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/pinfo-rails.rb
Overview
extend String for colors
Constant Summary collapse
- COLORS =
{ black: 30, light_black: 90, red: 31, light_red: 91, green: 32, light_green: 92, yellow: 33, light_yellow: 93, blue: 34, light_blue: 94, magenta: 35, light_magenta: 95, cyan: 36, light_cyan: 96, white: 37, light_white: 97, default: 39 }.freeze
Instance Method Summary collapse
Instance Method Details
#color(col) ⇒ Object
20 21 22 |
# File 'lib/pinfo-rails.rb', line 20 def color( col ) "\e[#{COLORS[col]}m#{self}\e[0m" end |