Class: Bookwatch::Colorizer

Inherits:
Object
  • Object
show all
Defined in:
lib/bookwatch/colorizer.rb

Constant Summary collapse

Colors =
OpenStruct.new(
  green: ->(msg) { ANSI.green {msg} },
  red: ->(msg) { ANSI.red {msg} },
  yellow: ->(msg) { ANSI.yellow {msg} },
)

Instance Method Summary collapse

Instance Method Details

#colorize(string, color) ⇒ Object



12
13
14
# File 'lib/bookwatch/colorizer.rb', line 12

def colorize(string, color)
  color.call string.to_s
end