Class: Mutant::Color
- Inherits:
-
Object
- Object
- Mutant::Color
- Includes:
- Adamantium::Flat
- Defined in:
- lib/mutant/color.rb
Overview
Class to colorize strings
Constant Summary collapse
- RED =
Color.new(31)
- GREEN =
Color.new(32)
- BLUE =
Color.new(34)
Instance Method Summary collapse
-
#format(text) ⇒ String
private
Format text with color.
Instance Method Details
#format(text) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Format text with color
16 17 18 |
# File 'lib/mutant/color.rb', line 16 def format(text) "\e[#{@code}m#{text}\e[0m" end |