class Bookwatch::Streams::ColorizedStream
Attributes
color[R]
colorizer[R]
stream[R]
Public Class Methods
new(color, stream)
click to toggle source
# File lib/bookwatch/streams/colorized_stream.rb, line 6 def initialize(color, stream) @color = color @stream = stream @colorizer = Colorizer.new end
Public Instance Methods
<<(text)
click to toggle source
# File lib/bookwatch/streams/colorized_stream.rb, line 16 def <<(text) stream << colorizer.colorize(text, color) end
puts(line)
click to toggle source
# File lib/bookwatch/streams/colorized_stream.rb, line 12 def puts(line) stream.puts(colorizer.colorize(line, color)) end