Module: AmazingPrint::Colorize
- Included in:
- Formatter, Formatters::BaseFormatter
- Defined in:
- lib/amazing_print/colorize.rb
Instance Method Summary collapse
-
#colorize(str, type) ⇒ Object
Pick the color and apply it to the given string as necessary.
Instance Method Details
#colorize(str, type) ⇒ Object
Pick the color and apply it to the given string as necessary.
11 12 13 14 15 16 |
# File 'lib/amazing_print/colorize.rb', line 11 def colorize(str, type) str = CGI.escapeHTML(str) if [:html] return str if [:plain] || ![:color][type] || !inspector.colorize? AmazingPrint::Colors.public_send([:color][type], str, [:html]) end |