Class: Viewpoint::EWS::SOAP::EwsResponse
- Inherits:
-
Object
- Object
- Viewpoint::EWS::SOAP::EwsResponse
- Includes:
- StringUtils
- Defined in:
- lib/ews/soap/ews_response.rb
Overview
A Generic Class for SOAP returns.
Constant Summary
Constants included from StringUtils
Instance Method Summary collapse
- #body ⇒ Object
- #envelope ⇒ Object
- #header ⇒ Object
-
#initialize(sax_hash) ⇒ EwsResponse
constructor
A new instance of EwsResponse.
- #response ⇒ Object
- #response_messages ⇒ Object
Methods included from StringUtils
Constructor Details
#initialize(sax_hash) ⇒ EwsResponse
Returns a new instance of EwsResponse.
25 26 27 28 |
# File 'lib/ews/soap/ews_response.rb', line 25 def initialize(sax_hash) @resp = sax_hash simplify! end |
Instance Method Details
#body ⇒ Object
38 39 40 |
# File 'lib/ews/soap/ews_response.rb', line 38 def body envelope[1][:body][:elems] end |
#envelope ⇒ Object
30 31 32 |
# File 'lib/ews/soap/ews_response.rb', line 30 def envelope @resp[:envelope][:elems] end |
#header ⇒ Object
34 35 36 |
# File 'lib/ews/soap/ews_response.rb', line 34 def header envelope[0][:header][:elems] end |
#response ⇒ Object
42 43 44 |
# File 'lib/ews/soap/ews_response.rb', line 42 def response body[0] end |
#response_messages ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/ews/soap/ews_response.rb', line 46 def return @response_messages if @response_messages @response_messages = [] response_type = response.keys.first response[response_type][:elems][0][:response_messages][:elems].each do |rm| = rm.keys[0] rm_klass = class_by_name() @response_messages << rm_klass.new(rm) end @response_messages end |