Class: Taeval::Output

Inherits:
Object
  • Object
show all
Defined in:
lib/taeval/output.rb

Instance Method Summary collapse

Constructor Details

#initialize(conf_h) ⇒ Output

Returns a new instance of Output.



4
5
6
# File 'lib/taeval/output.rb', line 4

def initialize(conf_h)
  @verbose = conf_h.fetch('verbose', false)
end

Instance Method Details



8
9
10
11
12
13
14
# File 'lib/taeval/output.rb', line 8

def print(header, stdout = '', stderr = '')
  if @verbose
    puts "\e[95m#{header}\e[0m"
    puts "\e[97m#{stdout}\e[0m" if !stdout.nil? && !stdout.empty?
    puts "\e[91m#{stderr}\e[0m" if !stderr.nil? && !stderr.empty?
  end
end