class SSHake::Response

Attributes

bytes_streamed[RW]
command[RW]
exit_code[RW]
exit_signal[RW]
finish_time[RW]
start_time[RW]
stderr[RW]
stdout[RW]

Public Class Methods

new(cached: false) click to toggle source
# File lib/sshake/response.rb, line 6
def initialize(cached: false)
  @stdout = ''
  @stderr = ''
  @exit_code = 0
  @bytes_streamed = 0
  @cached = cached
end

Public Instance Methods

cached!() click to toggle source
# File lib/sshake/response.rb, line 24
def cached!
  @cached = true
end
cached?() click to toggle source
# File lib/sshake/response.rb, line 20
def cached?
  @cached == true
end
success?() click to toggle source
# File lib/sshake/response.rb, line 16
def success?
  @exit_code.zero?
end
time() click to toggle source
# File lib/sshake/response.rb, line 28
def time
  (finish_time - start_time).to_i
end
timeout!() click to toggle source
# File lib/sshake/response.rb, line 36
def timeout!
  @exit_code = -255
end
timeout?() click to toggle source
# File lib/sshake/response.rb, line 32
def timeout?
  @exit_code == -255
end