Module: Dry::CLI::Banner::ColorMethods Private
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.
Defined Under Namespace
Classes: NoColorPastel
Constant Summary collapse
- COLOR_METHODS =
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.
%i[ yellow green red blue magenta cyan white black gray bright_white bright_black bright_red bright_green bright_blue bright_magenta bright_cyan bright_gray ].freeze
- DECORATIONS =
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.
Pastel answers a colour two ways:
yellow("text")decorates in one call,yellow.bold("text")returns a chain to decorate further. The colourless stand-in has to answer both shapes, so given text it hands the text straight back and given nothing it hands back itself. %i[bold dim italic underline inverse strikethrough blink].freeze
Instance Method Summary collapse
- #pastel ⇒ Object private
Instance Method Details
#pastel ⇒ Object
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.
121 122 123 124 125 126 127 |
# File 'lib/dry/cli/banner.rb', line 121 def pastel @pastel ||= if Banner.color_enabled? Pastel.new else NoColorPastel.new end end |