Class: Nissh::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/nissh/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResponse

Returns a new instance of Response.



6
7
8
# File 'lib/nissh/response.rb', line 6

def initialize
  reset_output!
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



4
5
6
# File 'lib/nissh/response.rb', line 4

def command
  @command
end

#exit_codeObject

Returns the value of attribute exit_code.



4
5
6
# File 'lib/nissh/response.rb', line 4

def exit_code
  @exit_code
end

#exit_signalObject

Returns the value of attribute exit_signal.



4
5
6
# File 'lib/nissh/response.rb', line 4

def exit_signal
  @exit_signal
end

#stderrObject

Returns the value of attribute stderr.



4
5
6
# File 'lib/nissh/response.rb', line 4

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout.



4
5
6
# File 'lib/nissh/response.rb', line 4

def stdout
  @stdout
end

Instance Method Details

#outputObject



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

Returns:

  • (Boolean)


10
11
12
# File 'lib/nissh/response.rb', line 10

def success?
  exit_code == 0
end