Method: Terminal.print

Defined in:
lib/terminal.rb,
lib/terminal.rb,
lib/terminal.rb

Writes the given objects to the terminal. Optionally interprets embedded BBCode.

Parameters:

  • objects (Array<#to_s>)

    any number of objects to write

  • bbcode (true|false) (defaults to: true)

    whether to interpret embedded BBCode

Returns:

  • (nil)


226
227
228
229
230
231
232
# File 'lib/terminal.rb', line 226

def print(*objects, bbcode: true)
  return if @out.nil? || objects.empty?
  return @out.print(*objects) unless bbcode
  @out.print(*objects.map! { Ansi.bbcode(_1) })
rescue IOError
  @out = nil
end