Class: Viewpoint::EWS::SOAP::EwsSoapFreeBusyResponse

Inherits:
EwsSoapResponse show all
Defined in:
lib/ews/soap/ews_soap_free_busy_response.rb

Instance Attribute Summary

Attributes inherited from EwsSoapResponse

#:message

Instance Method Summary collapse

Methods inherited from EwsSoapResponse

#response_messages

Constructor Details

#initialize(sax_hash) ⇒ EwsSoapFreeBusyResponse

Returns a new instance of EwsSoapFreeBusyResponse.



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

def initialize(sax_hash)
  @resp = sax_hash
  simplify!
end

Instance Method Details

#bodyObject



36
37
38
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 36

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

#calendar_event_arrayObject



48
49
50
51
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 48

def calendar_event_array
  result = find_in_hash_list(get_user_availability_response[1][:free_busy_view][:elems], :calendar_event_array)
  result ? result[:elems] : []
end

#envelopeObject



28
29
30
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 28

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

#get_user_availability_responseObject



40
41
42
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 40

def get_user_availability_response
  body.first[:get_user_availability_response][:elems].first[:free_busy_response_array][:elems].first[:free_busy_response][:elems]
end

#headerObject



32
33
34
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 32

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

#responseObject



44
45
46
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 44

def response
  body
end

#response_classObject Also known as: status



61
62
63
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 61

def response_class
  response_message[:attribs][:response_class]
end

#response_codeObject Also known as: code



66
67
68
69
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 66

def response_code
  result = find_in_hash_list(response_message[:elems], :response_code)
  result ? result[:text] : nil
end

#response_keyObject



77
78
79
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 77

def response_key
  response_message[:elems]
end

#response_messageObject



57
58
59
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 57

def response_message
  find_in_hash_list(get_user_availability_response, :response_message)
end

#response_message_textObject Also known as: message



72
73
74
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 72

def response_message_text
  guard_hash response_message[:elems], [:message_text, :text]
end

#success?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 81

def success?
  response_class == "Success"
end

#working_hoursObject



53
54
55
# File 'lib/ews/soap/ews_soap_free_busy_response.rb', line 53

def working_hours
  get_user_availability_response[1][:free_busy_view][:elems][2][:working_hours][:elems]
end