Class: CheekyDreams::StdIOAuditor

Inherits:
Object
  • Object
show all
Defined in:
lib/cheeky-dreams.rb

Instance Method Summary collapse

Constructor Details

#initialize(out = STDOUT, err = STDERR) ⇒ StdIOAuditor

Returns a new instance of StdIOAuditor.



62
63
64
# File 'lib/cheeky-dreams.rb', line 62

def initialize out = STDOUT, err = STDERR
  @out, @err = out, err
end

Instance Method Details

#audit(type, message) ⇒ Object



66
67
68
69
70
71
72
73
# File 'lib/cheeky-dreams.rb', line 66

def audit type, message
  case type
  when :error
    @err.puts "#{type} - #{message}"
  else
    @out.puts "#{type} - #{message}"
  end
end