Class: Viewpoint::EWS::SOAP::EwsSoapResponse
- Inherits:
-
Object
- Object
- Viewpoint::EWS::SOAP::EwsSoapResponse
show all
- Defined in:
- lib/ews/soap/ews_soap_response.rb
Overview
A Generic Class for SOAP returns.
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of EwsSoapResponse.
25
26
27
28
|
# File 'lib/ews/soap/ews_soap_response.rb', line 25
def initialize(sax_hash)
@resp = sax_hash
simplify!
end
|
Instance Attribute Details
#:message ⇒ String
The text from the EWS element <m:ResponseCode>
23
24
25
|
# File 'lib/ews/soap/ews_soap_response.rb', line 23
def :message
@:message
end
|
Instance Method Details
#body ⇒ Object
38
39
40
|
# File 'lib/ews/soap/ews_soap_response.rb', line 38
def body
envelope[1][:body][:elems]
end
|
#envelope ⇒ Object
30
31
32
|
# File 'lib/ews/soap/ews_soap_response.rb', line 30
def envelope
@resp[:envelope][:elems]
end
|
34
35
36
|
# File 'lib/ews/soap/ews_soap_response.rb', line 34
def
envelope[0][:header][:elems]
end
|
#response ⇒ Object
42
43
44
|
# File 'lib/ews/soap/ews_soap_response.rb', line 42
def response
body[0]
end
|
#response_class ⇒ Object
Also known as:
status
56
57
58
|
# File 'lib/ews/soap/ews_soap_response.rb', line 56
def response_class
response_message[:attribs][:response_class]
end
|
#response_code ⇒ Object
Also known as:
code
61
62
63
|
# File 'lib/ews/soap/ews_soap_response.rb', line 61
def response_code
response_message[:elems][:response_code][:text]
end
|
#response_message ⇒ Object
51
52
53
54
|
# File 'lib/ews/soap/ews_soap_response.rb', line 51
def response_message
key = response_messages[0].keys.first
response_messages[0][key]
end
|
#response_message_text ⇒ Object
Also known as:
message
66
67
68
|
# File 'lib/ews/soap/ews_soap_response.rb', line 66
def response_message_text
guard_hash response_message[:elems], [:message_text, :text]
end
|
#response_messages ⇒ Object
46
47
48
49
|
# File 'lib/ews/soap/ews_soap_response.rb', line 46
def response_messages
key = response.keys.first
response[key][:elems].find{|e| e.keys.include? :response_messages }[:response_messages][:elems]
end
|
#success? ⇒ Boolean
71
72
73
|
# File 'lib/ews/soap/ews_soap_response.rb', line 71
def success?
response_class == "Success"
end
|