class Snp::Printer
This class is responsible for outputing string in normal output and error streams. It defaults to `STDOUT` and `STDERR`, respectively but can be used to generate output for other streams.
Example
stream = Snp::Printer.new stream.out('Hello') # => 'Hello' is written to the standard output stream.err('ERROR!') # => 'ERROR!' is written to the standard error
Public Class Methods
new(out = STDOUT, err = STDERR)
click to toggle source
# File lib/snp/cli.rb, line 17 def initialize(out = STDOUT, err = STDERR) @out = out @err = err end
Public Instance Methods
err(message)
click to toggle source
# File lib/snp/cli.rb, line 26 def err(message) @err.puts message end
out(message)
click to toggle source
# File lib/snp/cli.rb, line 22 def out(message) @out.puts message end