Module: Wright::Util::Color Private
- Defined in:
- lib/wright/util/color.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
ANSI color helpers.
Class Method Summary collapse
-
.colorize(string, color) ⇒ String
private
Colorizes a string.
-
.red(string) ⇒ String
private
Colorizes a string (red).
-
.yellow(string) ⇒ String
private
Colorizes a string (yellow).
Class Method Details
.colorize(string, color) ⇒ 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.
Colorizes a string.
36 37 38 39 40 |
# File 'lib/wright/util/color.rb', line 36 def self.colorize(string, color) no_color = COLOR_MAP[:none] color = COLOR_MAP.fetch(color, no_color) "#{color}#{string}#{no_color}" end |
.red(string) ⇒ 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.
Colorizes a string (red).
10 11 12 |
# File 'lib/wright/util/color.rb', line 10 def self.red(string) colorize(string, :red) end |
.yellow(string) ⇒ 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.
Colorizes a string (yellow).
19 20 21 |
# File 'lib/wright/util/color.rb', line 19 def self.yellow(string) colorize(string, :yellow) end |