Class: PSRP::ResponseHandler
- Inherits:
-
Object
- Object
- PSRP::ResponseHandler
- Defined in:
- lib/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
-
#initialize(response_body, status_code) ⇒ ResponseHandler
constructor
A new instance of ResponseHandler.
-
#parse_to_xml ⇒ Object
Processes the response from the WinRM service and either returns an XML doc or raises an appropriate error.
Constructor Details
#initialize(response_body, status_code) ⇒ ResponseHandler
Returns a new instance of ResponseHandler.
66 67 68 69 |
# File 'lib/response_handler.rb', line 66 def initialize(response_body, status_code) @response_body = response_body @status_code = status_code end |
Instance Method Details
#parse_to_xml ⇒ Object
Processes the response from the WinRM service and either returns an XML doc or raises an appropriate error.
75 76 77 78 |
# File 'lib/response_handler.rb', line 75 def parse_to_xml raise_if_error response_xml end |