Class: CommandExec::Formatter::Hash
- Inherits:
-
Object
- Object
- CommandExec::Formatter::Hash
- Includes:
- CommandExec::FieldHelper
- Defined in:
- lib/command_exec/formatter/hash.rb
Overview
Style hash
Instance Attribute Summary collapse
-
#logger ⇒ Object
writeonly
Sets the attribute logger.
-
#output(*fields) ⇒ Hash
readonly
Output the prepared output.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Hash
constructor
Create new hash 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 = {}) ⇒ Hash
Create new hash formatter
29 30 31 32 33 34 35 36 37 |
# File 'lib/command_exec/formatter/hash.rb', line 29 def initialize(={}) = { logger: Logger.new($stdout), }.deep_merge @logger = [:logger] super() end |
Instance Attribute Details
#logger=(value) ⇒ Object (writeonly)
Sets the attribute logger
17 18 19 |
# File 'lib/command_exec/formatter/hash.rb', line 17 def logger=(value) @logger = value end |
#output(*fields) ⇒ Hash (readonly)
Output the prepared output
14 15 16 |
# File 'lib/command_exec/formatter/hash.rb', line 14 def output @output end |
Instance Method Details
#status(value) ⇒ Object
39 40 41 |
# File 'lib/command_exec/formatter/hash.rb', line 39 def status(value) prepare_status(value) end |