Class: Viewpoint::EWS::SOAP::EwsSoapResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/ews/soap/ews_soap_response.rb

Overview

A Generic Class for SOAP returns.

Direct Known Subclasses

EwsSoapAvailabilityResponse, EwsSoapFreeBusyResponse

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (EwsSoapResponse) initialize(sax_hash)

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

- (String) :message (readonly)

The text from the EWS element <m:ResponseCode>

Returns:

  • (String)

    the current value of :message



23
24
25
# File 'lib/ews/soap/ews_soap_response.rb', line 23

def :message
  @:message
end

Instance Method Details

- (Object) body



38
39
40
# File 'lib/ews/soap/ews_soap_response.rb', line 38

def body
  envelope[1][:body][:elems]
end

- (Object) envelope



30
31
32
# File 'lib/ews/soap/ews_soap_response.rb', line 30

def envelope
  @resp[:envelope][:elems]
end

- (Object) header



34
35
36
# File 'lib/ews/soap/ews_soap_response.rb', line 34

def header
  envelope[0][:header][:elems]
end

- (Object) response



42
43
44
# File 'lib/ews/soap/ews_soap_response.rb', line 42

def response
  body[0]
end

- (Object) response_class 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

- (Object) response_code 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

- (Object) response_message



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

- (Object) response_message_text 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

- (Object) response_messages



46
47
48
49
# File 'lib/ews/soap/ews_soap_response.rb', line 46

def response_messages
  key = response.keys.first
  response[key][:elems][0][:response_messages][:elems]
end

- (Boolean) success?

Returns:

  • (Boolean)


71
72
73
# File 'lib/ews/soap/ews_soap_response.rb', line 71

def success?
  response_class == "Success"
end