Class: CommandExec::Formatter::Array
- Inherits:
-
Object
- Object
- CommandExec::Formatter::Array
- Includes:
- CommandExec::FieldHelper
- Defined in:
- lib/command_exec/formatter/array.rb
Overview
Style array
Direct Known Subclasses
Instance Attribute Summary collapse
-
#logger ⇒ Object
writeonly
Sets the attribute logger.
-
#output(*fields) ⇒ Array
readonly
Output the prepared output.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Array
constructor
Create new array formatter.
- #status(value) ⇒ Object
Methods included from CommandExec::FieldHelper
#end_time, #executable, #log_file, #pid, #reason_for_failure, #return_code, #start_time, #stderr, #stdout
Constructor Details
#initialize(options = {}) ⇒ Array
Create new array formatter
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/command_exec/formatter/array.rb', line 39 def initialize(={}) = { headers: { names: {}, prefix: '=' * 5, suffix: '=' * 5, halign: :center, show: true, }, logger: Logger.new($stdout), }.deep_merge(header_names.deep_merge()) = [:headers] @logger = [:logger] super() end |
Instance Attribute Details
#logger=(value) ⇒ Object (writeonly)
Sets the attribute logger
17 18 19 |
# File 'lib/command_exec/formatter/array.rb', line 17 def logger=(value) @logger = value end |
#output(*fields) ⇒ Array (readonly)
Output the prepared output
14 15 16 |
# File 'lib/command_exec/formatter/array.rb', line 14 def output @output end |
Instance Method Details
#status(value) ⇒ Object
57 58 59 |
# File 'lib/command_exec/formatter/array.rb', line 57 def status(value) prepare_status(value, color: true) end |