Class: Fog::SSH::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/core/ssh.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Result

Returns a new instance of Result.



151
152
153
154
155
# File 'lib/fog/core/ssh.rb', line 151

def initialize(command)
  @command = command
  @stderr = ""
  @stdout = ""
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



136
137
138
# File 'lib/fog/core/ssh.rb', line 136

def command
  @command
end

#statusObject

Returns the value of attribute status.



136
137
138
# File 'lib/fog/core/ssh.rb', line 136

def status
  @status
end

#stderrObject

Returns the value of attribute stderr.



136
137
138
# File 'lib/fog/core/ssh.rb', line 136

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout.



136
137
138
# File 'lib/fog/core/ssh.rb', line 136

def stdout
  @stdout
end

Instance Method Details

#display_stderrObject



147
148
149
# File 'lib/fog/core/ssh.rb', line 147

def display_stderr
  Fog::Formatador.display_line(stderr.split("\r\n"))
end

#display_stdoutObject



138
139
140
141
142
143
144
145
# File 'lib/fog/core/ssh.rb', line 138

def display_stdout
  data = stdout.split("\r\n")
  if data.is_a?(String)
    Fog::Formatador.display_line(data)
  elsif data.is_a?(Array)
    Fog::Formatador.display_lines(data)
  end
end