Class: Circler::StepPrinter
- Inherits:
-
Object
- Object
- Circler::StepPrinter
- Defined in:
- lib/circler/printer/step_printer.rb
Instance Method Summary collapse
-
#initialize(steps, pretty: true) ⇒ StepPrinter
constructor
A new instance of StepPrinter.
- #to_s ⇒ Object
Constructor Details
#initialize(steps, pretty: true) ⇒ StepPrinter
Returns a new instance of StepPrinter.
5 6 7 8 |
# File 'lib/circler/printer/step_printer.rb', line 5 def initialize(steps, pretty: true) @steps = steps @pretty = pretty end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/circler/printer/step_printer.rb', line 10 def to_s Terminal::Table.new do |t| @steps .group_by(&:type) .each do |key, steps| t << :separator t << [{ value: key.green, alignment: :center, colspan: 2 }] steps.each { |s| print_actions(t, s) } end end.to_s end |