module AmazingPrint::Colorize

Public Instance Methods

colorize(str, type) click to toggle source

Pick the color and apply it to the given string as necessary.

# File lib/amazing_print/colorize.rb, line 11
def colorize(str, type)
  str = CGI.escapeHTML(str) if options[:html]
  return str if options[:plain] || !options[:color][type] || !inspector.colorize?

  AmazingPrint::Colors.public_send(options[:color][type], str, options[:html])
end