Class: Invoker::ProcessPrinter
- Inherits:
-
Object
- Object
- Invoker::ProcessPrinter
- Defined in:
- lib/invoker/process_printer.rb
Constant Summary collapse
- MAX_COLUMN_WIDTH =
40
Instance Attribute Summary collapse
-
#list_response ⇒ Object
Returns the value of attribute list_response.
Instance Method Summary collapse
-
#initialize(list_response) ⇒ ProcessPrinter
constructor
A new instance of ProcessPrinter.
- #print_table ⇒ Object
Constructor Details
#initialize(list_response) ⇒ ProcessPrinter
Returns a new instance of ProcessPrinter.
6 7 8 |
# File 'lib/invoker/process_printer.rb', line 6 def initialize(list_response) self.list_response = list_response end |
Instance Attribute Details
#list_response ⇒ Object
Returns the value of attribute list_response.
4 5 6 |
# File 'lib/invoker/process_printer.rb', line 4 def list_response @list_response end |
Instance Method Details
#print_table ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/invoker/process_printer.rb', line 10 def print_table hash_with_colors = [] list_response.processes.each do |process| if process.pid hash_with_colors << colorize_hash(process, "green") else hash_with_colors << colorize_hash(process, "light_black") end end Formatador.display_compact_table(hash_with_colors) end |