Class: FactoryTrace::Writers::ReportWriter
- Defined in:
- lib/factory_trace/writers/report_writer.rb
Constant Summary collapse
- COLORS =
{ blue: "\e[34m", yellow: "\e[33m", green: "\e[32m", red: "\e[31m" }.freeze
- CODES =
{ used: "used", unused: "unused" }.freeze
Instance Attribute Summary
Attributes inherited from Writer
Instance Method Summary collapse
Methods inherited from Writer
Constructor Details
This class inherits a constructor from FactoryTrace::Writers::Writer
Instance Method Details
#write(results) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/factory_trace/writers/report_writer.rb', line 19 def write(results) total_color = (results.any? { |result| result[:code] == :unused && !result.key?(:value) }) ? :red : :green results.each do |result| io.puts(convert(result, total_color: total_color)) end end |