Class: Nissh::Response
- Inherits:
-
Object
- Object
- Nissh::Response
- Defined in:
- lib/nissh/response.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#exit_code ⇒ Object
Returns the value of attribute exit_code.
-
#exit_signal ⇒ Object
Returns the value of attribute exit_signal.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Instance Method Summary collapse
-
#initialize ⇒ Response
constructor
A new instance of Response.
- #output ⇒ Object
- #reset_output! ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize ⇒ Response
Returns a new instance of Response.
6 7 8 |
# File 'lib/nissh/response.rb', line 6 def initialize reset_output! end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
4 5 6 |
# File 'lib/nissh/response.rb', line 4 def command @command end |
#exit_code ⇒ Object
Returns the value of attribute exit_code.
4 5 6 |
# File 'lib/nissh/response.rb', line 4 def exit_code @exit_code end |
#exit_signal ⇒ Object
Returns the value of attribute exit_signal.
4 5 6 |
# File 'lib/nissh/response.rb', line 4 def exit_signal @exit_signal end |
#stderr ⇒ Object
Returns the value of attribute stderr.
4 5 6 |
# File 'lib/nissh/response.rb', line 4 def stderr @stderr end |
#stdout ⇒ Object
Returns the value of attribute stdout.
4 5 6 |
# File 'lib/nissh/response.rb', line 4 def stdout @stdout end |
Instance Method Details
#output ⇒ Object
14 15 16 |
# File 'lib/nissh/response.rb', line 14 def output "#{stdout}\n#{stderr}" end |
#reset_output! ⇒ Object
18 19 20 21 |
# File 'lib/nissh/response.rb', line 18 def reset_output! @stdout = "" @stderr = "" end |
#success? ⇒ Boolean
10 11 12 |
# File 'lib/nissh/response.rb', line 10 def success? exit_code == 0 end |