Class: Ridley::HostConnector::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/ridley-connectors/host_connector/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, options = {}) ⇒ Response

Returns a new instance of Response.



11
12
13
14
15
16
17
# File 'lib/ridley-connectors/host_connector/response.rb', line 11

def initialize(host, options = {})
  @host        = host
  @stdout      = options[:stdout] || String.new
  @stderr      = options[:stderr] || String.new
  @exit_code   = options[:exit_code] || -1
  @exit_signal = options[:exit_signal] || nil
end

Instance Attribute Details

#exit_codeObject

Returns the value of attribute exit_code.



8
9
10
# File 'lib/ridley-connectors/host_connector/response.rb', line 8

def exit_code
  @exit_code
end

#exit_signalObject

Returns the value of attribute exit_signal.



9
10
11
# File 'lib/ridley-connectors/host_connector/response.rb', line 9

def exit_signal
  @exit_signal
end

#hostObject (readonly)

Returns the value of attribute host.



4
5
6
# File 'lib/ridley-connectors/host_connector/response.rb', line 4

def host
  @host
end

#stderrObject

Returns the value of attribute stderr.



7
8
9
# File 'lib/ridley-connectors/host_connector/response.rb', line 7

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout.



6
7
8
# File 'lib/ridley-connectors/host_connector/response.rb', line 6

def stdout
  @stdout
end

Instance Method Details

#error?Boolean

Return true if the response was not successful

Returns:

  • (Boolean)


22
23
24
# File 'lib/ridley-connectors/host_connector/response.rb', line 22

def error?
  self.exit_code != 0
end