Class: Bkblz::Logger::Styleizer

Inherits:
Object
  • Object
show all
Defined in:
lib/bkblz/logger.rb

Constant Summary collapse

STYLE_CODES =
{
  :bold => 1,
  :red => 31,
  :green => 32,
  :yellow => 33,
  :blue => 34,
  :pink => 35,
  :light_blue => 36,
  :light_gray => 37,
  :dark_gray => 90
}

Class Method Summary collapse

Class Method Details

.apply(str, *styles) ⇒ Object



126
127
128
129
# File 'lib/bkblz/logger.rb', line 126

def apply(str, *styles)
  return str unless str
  styles.reduce(str) { |str, style| styleize STYLE_CODES[style], str }
end