class Loom::Logger::Styleizer

Constants

STYLE_CODES

Public Class Methods

apply(str, *styles) click to toggle source
# File lib/loom/logger.rb, line 128
def apply(str, *styles)
  return str unless str
  styles.reduce(str) { |str, style| styleize STYLE_CODES[style], str }
end

Private Class Methods

styleize(color_code, str) click to toggle source
# File lib/loom/logger.rb, line 134
def styleize(color_code, str)
  "\e[#{color_code}m#{str}\e[0m"
end