Class: Moonshot::StackOutputPrinter

Inherits:
Object
  • Object
show all
Defined in:
lib/moonshot/stack_output_printer.rb

Overview

Display the stack outputs to the user.

Instance Method Summary collapse

Constructor Details

#initialize(stack, table) ⇒ StackOutputPrinter

Returns a new instance of StackOutputPrinter.



6
7
8
9
# File 'lib/moonshot/stack_output_printer.rb', line 6

def initialize(stack, table)
  @stack = stack
  @table = table
end

Instance Method Details



11
12
13
14
15
16
17
# File 'lib/moonshot/stack_output_printer.rb', line 11

def print
  o_table = @table.add_leaf('Stack Outputs')
  rows = @stack.outputs.sort.map do |key, value|
    ["#{key}:", value]
  end
  o_table.add_table(rows)
end