Class: AwesomeSpawn::CommandResult
- Inherits:
-
Object
- Object
- AwesomeSpawn::CommandResult
- Defined in:
- lib/awesome_spawn/command_result.rb
Instance Attribute Summary collapse
-
#command_line ⇒ Object
readonly
Returns the value of attribute command_line.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#exit_status ⇒ Object
readonly
Returns the value of attribute exit_status.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(command_line, output, error, pid, exit_status) ⇒ CommandResult
constructor
A new instance of CommandResult.
- #inspect ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(command_line, output, error, pid, exit_status) ⇒ CommandResult
Returns a new instance of CommandResult.
5 6 7 8 9 10 11 |
# File 'lib/awesome_spawn/command_result.rb', line 5 def initialize(command_line, output, error, pid, exit_status) @command_line = command_line @output = output @error = error @pid = pid @exit_status = exit_status end |
Instance Attribute Details
#command_line ⇒ Object (readonly)
Returns the value of attribute command_line.
3 4 5 |
# File 'lib/awesome_spawn/command_result.rb', line 3 def command_line @command_line end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
3 4 5 |
# File 'lib/awesome_spawn/command_result.rb', line 3 def error @error end |
#exit_status ⇒ Object (readonly)
Returns the value of attribute exit_status.
3 4 5 |
# File 'lib/awesome_spawn/command_result.rb', line 3 def exit_status @exit_status end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
3 4 5 |
# File 'lib/awesome_spawn/command_result.rb', line 3 def output @output end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
3 4 5 |
# File 'lib/awesome_spawn/command_result.rb', line 3 def pid @pid end |
Instance Method Details
#failure? ⇒ Boolean
17 18 19 |
# File 'lib/awesome_spawn/command_result.rb', line 17 def failure? exit_status != 0 end |
#inspect ⇒ Object
21 22 23 |
# File 'lib/awesome_spawn/command_result.rb', line 21 def inspect "#{to_s.chop} @exit_status=#{@exit_status}>" end |
#success? ⇒ Boolean
13 14 15 |
# File 'lib/awesome_spawn/command_result.rb', line 13 def success? exit_status == 0 end |