Class: FactoryTrace::Printer
- Inherits:
-
Object
- Object
- FactoryTrace::Printer
- Defined in:
- lib/factory_trace/printer.rb
Constant Summary collapse
- COLORS =
{ blue: "\e[34m", green: "\e[32m", red: "\e[31m" }.freeze
Instance Method Summary collapse
-
#initialize(io, config: Configuration.new) ⇒ Printer
constructor
A new instance of Printer.
- #print(results) ⇒ Object
Constructor Details
#initialize(io, config: Configuration.new) ⇒ Printer
Returns a new instance of Printer.
9 10 11 12 |
# File 'lib/factory_trace/printer.rb', line 9 def initialize(io, config: Configuration.new) @io = io @config = config end |
Instance Method Details
#print(results) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/factory_trace/printer.rb', line 15 def print(results) total_color = results.size == 2 ? :green : :red results.each do |result| io.puts(convert(result, total_color: total_color)) end end |