Method: Console.write

Defined in:
lib/color_console/console.rb

.write(text, fg = nil, bg = nil) ⇒ Object

Writes a partital line of text to the console, with optional foreground and background colors. No line-feed is output.

Parameters:

  • text (String)

    The text to be written to the console.

  • fg (Symbol) (defaults to: nil)

    An optional foreground colour name or value.

  • bg (Symbol) (defaults to: nil)

    An optional background color name or value.

See Also:

  • #puts


55
56
57
58
59
# File 'lib/color_console/console.rb', line 55

def write(text, fg = nil, bg = nil)
    @lock.synchronize do
        _write(text, fg, bg)
    end
end