Module: Choria::Colt::CLI::Formatter::Result
- Defined in:
- lib/choria/colt/cli/formatter.rb
Instance Method Summary collapse
- #exitcode ⇒ Object
- #ok? ⇒ Boolean
-
#output ⇒ Object
CLI.
- #runtime ⇒ Object
- #sender ⇒ Object
- #statuscode ⇒ Object
- #stderr ⇒ Object
Instance Method Details
#exitcode ⇒ Object
13 14 15 |
# File 'lib/choria/colt/cli/formatter.rb', line 13 def exitcode dig(:data, :exitcode) end |
#ok? ⇒ Boolean
17 18 19 |
# File 'lib/choria/colt/cli/formatter.rb', line 17 def ok? exitcode&.zero? end |
#output ⇒ Object
CLI
30 31 32 33 34 35 36 |
# File 'lib/choria/colt/cli/formatter.rb', line 30 def output if dig(:result, :_output).nil? JSON.pretty_generate(self[:result]).split("\n") else dig(:result, :_output) end end |
#runtime ⇒ Object
21 22 23 |
# File 'lib/choria/colt/cli/formatter.rb', line 21 def runtime dig(:data, :runtime) end |
#sender ⇒ Object
9 10 11 |
# File 'lib/choria/colt/cli/formatter.rb', line 9 def sender self[:sender] end |
#statuscode ⇒ Object
25 26 27 |
# File 'lib/choria/colt/cli/formatter.rb', line 25 def statuscode self[:statuscode] end |
#stderr ⇒ Object
38 39 40 |
# File 'lib/choria/colt/cli/formatter.rb', line 38 def stderr dig(:result, :_stderr) end |