Class: Net::SSH::Connection::Session::ExecStatus
- Inherits:
-
Object
- Object
- Net::SSH::Connection::Session::ExecStatus
- Defined in:
- lib/makitzo/monkeys/net-ssh.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
- #eql?(other) ⇒ Boolean
- #error? ⇒ Boolean
- #hash ⇒ Object
-
#initialize ⇒ ExecStatus
constructor
A new instance of ExecStatus.
- #inspect ⇒ Object
- #success? ⇒ Boolean
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ ExecStatus
Returns a new instance of ExecStatus.
5 6 7 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 5 def initialize @command, @stdout, @stderr, @exit_code, @exit_signal = "", "", "", 0, 0, nil end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
3 4 5 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 3 def command @command end |
#exit_code ⇒ Object
Returns the value of attribute exit_code.
3 4 5 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 3 def exit_code @exit_code end |
#exit_signal ⇒ Object
Returns the value of attribute exit_signal.
3 4 5 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 3 def exit_signal @exit_signal end |
#stderr ⇒ Object
Returns the value of attribute stderr.
3 4 5 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 3 def stderr @stderr end |
#stdout ⇒ Object
Returns the value of attribute stdout.
3 4 5 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 3 def stdout @stdout end |
Instance Method Details
#eql?(other) ⇒ Boolean
33 34 35 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 33 def eql?(other) other.is_a?(ExecStatus) && (command == other.command && exit_code == other.exit_code && stdout == other.stdout) end |
#error? ⇒ Boolean
13 14 15 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 13 def error? !success? end |
#hash ⇒ Object
29 30 31 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 29 def hash "#{command}\n#{exit_code}\n#{stdout}".hash end |
#inspect ⇒ Object
25 26 27 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 25 def inspect "<ExecStatus command=#{@command.inspect} stdout=#{@stdout.inspect} status=#{@exit_code}>" end |
#success? ⇒ Boolean
9 10 11 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 9 def success? @exit_code == 0 end |
#to_i ⇒ Object
17 18 19 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 17 def to_i @exit_code end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/makitzo/monkeys/net-ssh.rb', line 21 def to_s @stdout end |