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.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(command_line, output, error, exit_status) ⇒ CommandResult
constructor
A new instance of CommandResult.
- #inspect ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(command_line, output, error, exit_status) ⇒ CommandResult
Returns a new instance of CommandResult.
5 6 7 8 9 10 |
# File 'lib/awesome_spawn/command_result.rb', line 5 def initialize(command_line, output, error, exit_status) @command_line = command_line @output = output @error = error @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 |
Instance Method Details
#failure? ⇒ Boolean
16 17 18 |
# File 'lib/awesome_spawn/command_result.rb', line 16 def failure? exit_status != 0 end |
#inspect ⇒ Object
20 21 22 |
# File 'lib/awesome_spawn/command_result.rb', line 20 def inspect "#{to_s.chop} @exit_status=#{@exit_status}>" end |
#success? ⇒ Boolean
12 13 14 |
# File 'lib/awesome_spawn/command_result.rb', line 12 def success? exit_status == 0 end |