class Arcanus::Output

Encapsulates all communication to an output source.

Public Class Methods

new(stream) click to toggle source

Creates a new {Arcanus::Output} instance.

@param stream [IO] the output destination stream.

# File lib/arcanus/output.rb, line 14
def initialize(stream)
  @output_stream = stream
end
silent() click to toggle source

Creates a {Arcanus::Output} which displays nothing.

@return [Arcanus::Output]

# File lib/arcanus/output.rb, line 7
def self.silent
  new(File.open('/dev/null', 'w'))
end

Public Instance Methods

print(output) click to toggle source

Print the specified output.

@param [String] output the output to display

tty?() click to toggle source

Return if output is a TTY console.

@return [true,false]

# File lib/arcanus/output.rb, line 28
def tty?
  @output_stream.tty?
end