Class: Net::SSH::Connection::Session::ExecStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/makitzo/monkeys/net-ssh.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeExecStatus

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

#commandObject

Returns the value of attribute command.



3
4
5
# File 'lib/makitzo/monkeys/net-ssh.rb', line 3

def command
  @command
end

#exit_codeObject

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_signalObject

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

#stderrObject

Returns the value of attribute stderr.



3
4
5
# File 'lib/makitzo/monkeys/net-ssh.rb', line 3

def stderr
  @stderr
end

#stdoutObject

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

Returns:

  • (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

Returns:

  • (Boolean)


13
14
15
# File 'lib/makitzo/monkeys/net-ssh.rb', line 13

def error?
  !success?
end

#hashObject



29
30
31
# File 'lib/makitzo/monkeys/net-ssh.rb', line 29

def hash
  "#{command}\n#{exit_code}\n#{stdout}".hash
end

#inspectObject



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

Returns:

  • (Boolean)


9
10
11
# File 'lib/makitzo/monkeys/net-ssh.rb', line 9

def success?
  @exit_code == 0
end

#to_iObject



17
18
19
# File 'lib/makitzo/monkeys/net-ssh.rb', line 17

def to_i
  @exit_code
end

#to_sObject



21
22
23
# File 'lib/makitzo/monkeys/net-ssh.rb', line 21

def to_s
  @stdout
end