Class: Chef::Util::Powershell::CmdletResult
- Defined in:
- lib/chef/util/powershell/cmdlet_result.rb
Instance Attribute Summary collapse
-
#output_format ⇒ Object
readonly
Returns the value of attribute output_format.
Instance Method Summary collapse
-
#initialize(status, output_format) ⇒ CmdletResult
constructor
A new instance of CmdletResult.
- #return_value ⇒ Object
- #stderr ⇒ Object
- #succeeded? ⇒ Boolean
Constructor Details
#initialize(status, output_format) ⇒ CmdletResult
Returns a new instance of CmdletResult.
25 26 27 28 |
# File 'lib/chef/util/powershell/cmdlet_result.rb', line 25 def initialize(status, output_format) @status = status @output_format = output_format end |
Instance Attribute Details
#output_format ⇒ Object (readonly)
Returns the value of attribute output_format.
23 24 25 |
# File 'lib/chef/util/powershell/cmdlet_result.rb', line 23 def output_format @output_format end |
Instance Method Details
#return_value ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/chef/util/powershell/cmdlet_result.rb', line 34 def return_value if output_format == :object Chef::JSONCompat.parse(@status.stdout) else @status.stdout end end |
#stderr ⇒ Object
30 31 32 |
# File 'lib/chef/util/powershell/cmdlet_result.rb', line 30 def stderr @status.stderr end |
#succeeded? ⇒ Boolean
42 43 44 |
# File 'lib/chef/util/powershell/cmdlet_result.rb', line 42 def succeeded? @succeeded = @status.status.exitstatus == 0 end |