Class: Mutant::Color Private
- Inherits:
-
Object
- Object
- Mutant::Color
- Includes:
- Adamantium::Flat
- Defined in:
- lib/mutant/color.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class to colorize strings
Constant Summary collapse
- NONE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Class.new(self) do # Format null color # # @param [String] text # # @return [String] # the argument string def format(text) text end private # rubocop:disable AccessModifierIndentation # Initialize null color # # @return [undefined] def initialize end end.new
- RED =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Color.new(31)
- GREEN =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Color.new(32)
- BLUE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
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
11 12 13 |
# File 'lib/mutant/color.rb', line 11 def format(text) "\e[#{code}m#{text}\e[0m" end |