Class: Bosh::Exec::Result
- Inherits:
-
Object
- Object
- Bosh::Exec::Result
- Defined in:
- lib/common/exec/result.rb
Instance Attribute Summary collapse
-
#command ⇒ String
readonly
command that generated the result.
-
#exit_status ⇒ Integer
readonly
exit status of the command.
-
#output ⇒ String
readonly
output from the executed command.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(command, output, exit_status, not_found = false) ⇒ Result
constructor
A new instance of Result.
-
#not_found? ⇒ Boolean
true if the command was not found.
- #success? ⇒ Boolean
Constructor Details
#initialize(command, output, exit_status, not_found = false) ⇒ Result
Returns a new instance of Result.
15 16 17 18 19 20 |
# File 'lib/common/exec/result.rb', line 15 def initialize(command, output, exit_status, not_found=false) @command = command @output = output @exit_status = exit_status @not_found = not_found end |
Instance Attribute Details
#command ⇒ String (readonly)
command that generated the result
7 8 9 |
# File 'lib/common/exec/result.rb', line 7 def command @command end |
#exit_status ⇒ Integer (readonly)
exit status of the command
13 14 15 |
# File 'lib/common/exec/result.rb', line 13 def exit_status @exit_status end |
#output ⇒ String (readonly)
output from the executed command
10 11 12 |
# File 'lib/common/exec/result.rb', line 10 def output @output end |
Instance Method Details
#failed? ⇒ Boolean
26 27 28 |
# File 'lib/common/exec/result.rb', line 26 def failed? @exit_status != 0 || @not_found end |
#not_found? ⇒ Boolean
true if the command was not found
31 32 33 |
# File 'lib/common/exec/result.rb', line 31 def not_found? @not_found end |
#success? ⇒ Boolean
22 23 24 |
# File 'lib/common/exec/result.rb', line 22 def success? @exit_status == 0 end |