Class: WinRM::ResponseHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/winrm/http/response_handler.rb

Overview

Handles the raw WinRM HTTP response. Returns the body as an XML doc or raises the appropriate WinRM error if the response is an error.

Instance Method Summary collapse

Constructor Details

#initialize(response_body, status_code) ⇒ ResponseHandler

Returns a new instance of ResponseHandler.

Parameters:

  • The (String)

    raw unparsed response body, if any

  • The (Integer)

    HTTP response status code



26
27
28
29
# File 'lib/winrm/http/response_handler.rb', line 26

def initialize(response_body, status_code)
  @response_body = response_body
  @status_code = status_code
end

Instance Method Details

#parse_to_xmlObject

Processes the response from the WinRM service and either returns an XML doc or raises an appropriate error.



35
36
37
38
# File 'lib/winrm/http/response_handler.rb', line 35

def parse_to_xml
  raise_if_error
  response_xml
end