class Kojak::Printer::RandomlyColorized
Internal: Colorized logger that uses random color from the palette.
Constants
- PALETTE
Internal: List of colors to pick from. This list is always randomized on start.
Public Class Methods
new(out)
click to toggle source
Calls superclass method
Kojak::Printer::Colorized::new
# File lib/kojak/printer/randomly_colorized.rb, line 18 def initialize(out) super(out, nil) @current = -1 end
Public Instance Methods
color()
click to toggle source
# File lib/kojak/printer/randomly_colorized.rb, line 23 def color @@lock.synchronize do @current += 1 PALETTE[@current % PALETTE.size] end end