Class: DatabaseConsistency::Writers::SimpleWriter
- Inherits:
-
BaseWriter
- Object
- BaseWriter
- DatabaseConsistency::Writers::SimpleWriter
- Defined in:
- lib/database_consistency/writers/simple_writer.rb
Overview
The simplest formatter
Constant Summary collapse
- COLORS =
{ blue: "\e[34m", yellow: "\e[33m", green: "\e[32m", red: "\e[31m" }.freeze
- COLOR_BY_STATUS =
{ ok: :green, warning: :yellow, fail: :red }.freeze
Instance Attribute Summary
Attributes inherited from BaseWriter
Instance Method Summary collapse
Methods inherited from BaseWriter
Constructor Details
This class inherits a constructor from DatabaseConsistency::Writers::BaseWriter
Instance Method Details
#msg(result) ⇒ Object
29 30 31 |
# File 'lib/database_consistency/writers/simple_writer.rb', line 29 def msg(result) "#{result.checker_name} #{status_text(result)} #{key_text(result)} #{result.}" end |
#write ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/database_consistency/writers/simple_writer.rb', line 21 def write results.each do |result| next unless write?(result.status) puts msg(result) end end |