Class: WinRM::Output

Inherits:
Hash
  • Object
show all
Defined in:
lib/winrm/output.rb

Overview

This class holds raw output as a hash, and has convenience methods to parse.

Instance Method Summary collapse

Constructor Details

#initializeOutput

Returns a new instance of Output.



20
21
22
23
# File 'lib/winrm/output.rb', line 20

def initialize
  super
  self[:data] = []
end

Instance Method Details

#outputObject



25
26
27
28
29
# File 'lib/winrm/output.rb', line 25

def output
  self[:data].flat_map do |line|
    [line[:stdout], line[:stderr]]
  end.compact.join
end

#stderrObject



37
38
39
40
41
# File 'lib/winrm/output.rb', line 37

def stderr
  self[:data].map do |line|
    line[:stderr]
  end.compact.join
end

#stdoutObject



31
32
33
34
35
# File 'lib/winrm/output.rb', line 31

def stdout
  self[:data].map do |line|
    line[:stdout]
  end.compact.join
end