Class: Riddle::CommandResult
- Inherits:
-
Object
- Object
- Riddle::CommandResult
- Defined in:
- lib/riddle/command_result.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#successful ⇒ Object
Returns the value of attribute successful.
Instance Method Summary collapse
-
#initialize(command, status, output = nil, successful = nil) ⇒ CommandResult
constructor
A new instance of CommandResult.
Constructor Details
#initialize(command, status, output = nil, successful = nil) ⇒ CommandResult
Returns a new instance of CommandResult.
7 8 9 10 11 12 13 14 15 |
# File 'lib/riddle/command_result.rb', line 7 def initialize(command, status, output = nil, successful = nil) @command, @status, @output = command, status, output if successful.nil? @successful = (@status == 0) else @successful = successful end end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
4 5 6 |
# File 'lib/riddle/command_result.rb', line 4 def command @command end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
4 5 6 |
# File 'lib/riddle/command_result.rb', line 4 def output @output end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/riddle/command_result.rb', line 4 def status @status end |
#successful ⇒ Object
Returns the value of attribute successful.
5 6 7 |
# File 'lib/riddle/command_result.rb', line 5 def successful @successful end |