Class: Taeval::Output
- Inherits:
-
Object
- Object
- Taeval::Output
- Defined in:
- lib/taeval/output.rb
Instance Method Summary collapse
-
#initialize(conf_h) ⇒ Output
constructor
A new instance of Output.
- #print(header, stdout = '', stderr = '') ⇒ Object
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
#print(header, stdout = '', stderr = '') ⇒ Object
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 |