Class: CommandExec::Formatter::JSON
- Defined in:
- lib/command_exec/formatter/json.rb
Overview
Style as json string
Instance Attribute Summary
Attributes inherited from Hash
Instance Method Summary collapse
-
#output(*fields) ⇒ String
convert the prepared output to json.
Methods inherited from Hash
Methods included from CommandExec::FieldHelper
#end_time, #executable, #initialize, #log_file, #pid, #reason_for_failure, #return_code, #start_time, #stderr, #stdout
Constructor Details
This class inherits a constructor from CommandExec::Formatter::Hash
Instance Method Details
#output(*fields) ⇒ String
convert the prepared output to json
17 18 19 |
# File 'lib/command_exec/formatter/json.rb', line 17 def output(*fields) ::JSON.generate prepare_output(fields.flatten) end |