Module: Dapp::Helper::Paint
Overview
Paint
Constant Summary collapse
- FORMAT =
{ step: [:yellow, :bold], info: [:blue], success: [:green, :bold], warning: [:red, :bold], secondary: [:white, :bold], default: [:white] }.freeze
Instance Method Summary collapse
Instance Method Details
#paint_string(object, style_name) ⇒ Object
20 21 22 |
# File 'lib/dapp/helper/paint.rb', line 20 def paint_string(object, style_name) ::Paint[::Paint.unpaint(object.to_s), *paint_style(style_name)] end |
#paint_style(name) ⇒ Object
14 15 16 17 18 |
# File 'lib/dapp/helper/paint.rb', line 14 def paint_style(name) FORMAT[name].tap do |format| raise if format.nil? end end |