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.
13 14 15 16 17 18 |
# File 'lib/common/exec/result.rb', line 13 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
5 6 7 |
# File 'lib/common/exec/result.rb', line 5 def command @command end |
#exit_status ⇒ Integer (readonly)
exit status of the command
11 12 13 |
# File 'lib/common/exec/result.rb', line 11 def exit_status @exit_status end |
#output ⇒ String (readonly)
output from the executed command
8 9 10 |
# File 'lib/common/exec/result.rb', line 8 def output @output end |
Instance Method Details
#failed? ⇒ Boolean
24 25 26 |
# File 'lib/common/exec/result.rb', line 24 def failed? @exit_status != 0 || @not_found end |
#not_found? ⇒ Boolean
true if the command was not found
29 30 31 |
# File 'lib/common/exec/result.rb', line 29 def not_found? @not_found end |
#success? ⇒ Boolean
20 21 22 |
# File 'lib/common/exec/result.rb', line 20 def success? @exit_status == 0 end |