Class: WinRM::Output
- Inherits:
-
Hash
- Object
- Hash
- WinRM::Output
- 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
-
#initialize ⇒ Output
constructor
A new instance of Output.
- #output ⇒ Object
- #stderr ⇒ Object
- #stdout ⇒ Object
Constructor Details
#initialize ⇒ Output
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
#output ⇒ Object
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 |
#stderr ⇒ Object
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 |
#stdout ⇒ Object
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 |