Class: Moonshot::StackListPrinter
- Inherits:
-
Object
- Object
- Moonshot::StackListPrinter
- Defined in:
- lib/moonshot/stack_list_printer.rb
Instance Attribute Summary collapse
-
#stacks ⇒ Object
Returns the value of attribute stacks.
Instance Method Summary collapse
-
#initialize(stacks) ⇒ StackListPrinter
constructor
A new instance of StackListPrinter.
- #print ⇒ Object
Constructor Details
#initialize(stacks) ⇒ StackListPrinter
Returns a new instance of StackListPrinter.
7 8 9 10 |
# File 'lib/moonshot/stack_list_printer.rb', line 7 def initialize(stacks) @stacks = stacks @table = UnicodeTable.new('Environment List') end |
Instance Attribute Details
#stacks ⇒ Object
Returns the value of attribute stacks.
5 6 7 |
# File 'lib/moonshot/stack_list_printer.rb', line 5 def stacks @stacks end |
Instance Method Details
#print ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/moonshot/stack_list_printer.rb', line 12 def print rows = @stacks.map do |stack| [stack.name, stack.creation_time, stack.status] end @table.add_table(rows) @table.draw @table.draw_children end |