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.
5 6 7 8 9 10 11 12 13 |
# File 'lib/riddle/command_result.rb', line 5 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.
2 3 4 |
# File 'lib/riddle/command_result.rb', line 2 def command @command end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
2 3 4 |
# File 'lib/riddle/command_result.rb', line 2 def output @output end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
2 3 4 |
# File 'lib/riddle/command_result.rb', line 2 def status @status end |
#successful ⇒ Object
Returns the value of attribute successful.
3 4 5 |
# File 'lib/riddle/command_result.rb', line 3 def successful @successful end |