viewpoint 1.1.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -8
  3. data/lib/ews/calendar_accessors.rb +37 -33
  4. data/lib/ews/connection.rb +151 -124
  5. data/lib/ews/connection_helper.rb +36 -33
  6. data/lib/ews/convert_accessors.rb +58 -54
  7. data/lib/ews/errors.rb +59 -53
  8. data/lib/ews/ews_client.rb +92 -79
  9. data/lib/ews/exceptions/exceptions.rb +61 -61
  10. data/lib/ews/folder_accessors.rb +235 -234
  11. data/lib/ews/impersonation.rb +29 -23
  12. data/lib/ews/item_accessors.rb +215 -213
  13. data/lib/ews/mailbox_accessors.rb +82 -79
  14. data/lib/ews/meeting_accessors.rb +38 -31
  15. data/lib/ews/message_accessors.rb +83 -81
  16. data/lib/ews/push_subscription_accessors.rb +29 -27
  17. data/lib/ews/room_accessors.rb +48 -46
  18. data/lib/ews/roomlist_accessors.rb +47 -45
  19. data/lib/ews/soap/builders/ews_builder.rb +1186 -1188
  20. data/lib/ews/soap/ews_response.rb +68 -73
  21. data/lib/ews/soap/ews_soap_availability_response.rb +57 -57
  22. data/lib/ews/soap/ews_soap_free_busy_response.rb +115 -117
  23. data/lib/ews/soap/ews_soap_response.rb +99 -101
  24. data/lib/ews/soap/ews_soap_room_response.rb +45 -45
  25. data/lib/ews/soap/ews_soap_roomlist_response.rb +45 -46
  26. data/lib/ews/soap/exchange_availability.rb +54 -52
  27. data/lib/ews/soap/exchange_data_services.rb +693 -711
  28. data/lib/ews/soap/exchange_notification.rb +123 -128
  29. data/lib/ews/soap/exchange_synchronization.rb +82 -82
  30. data/lib/ews/soap/exchange_time_zones.rb +41 -44
  31. data/lib/ews/soap/exchange_user_configuration.rb +30 -27
  32. data/lib/ews/soap/exchange_web_service.rb +237 -233
  33. data/lib/ews/soap/parsers/ews_parser.rb +46 -42
  34. data/lib/ews/soap/parsers/ews_sax_document.rb +63 -58
  35. data/lib/ews/soap/response_message.rb +69 -68
  36. data/lib/ews/soap/responses/create_attachment_response_message.rb +45 -45
  37. data/lib/ews/soap/responses/create_item_response_message.rb +26 -25
  38. data/lib/ews/soap/responses/find_item_response_message.rb +76 -78
  39. data/lib/ews/soap/responses/get_events_response_message.rb +52 -51
  40. data/lib/ews/soap/responses/send_notification_response_message.rb +53 -51
  41. data/lib/ews/soap/responses/subscribe_response_message.rb +37 -34
  42. data/lib/ews/soap/responses/sync_folder_hierarchy_response_message.rb +38 -35
  43. data/lib/ews/soap/responses/sync_folder_items_response_message.rb +38 -35
  44. data/lib/ews/soap.rb +27 -26
  45. data/lib/ews/templates/calendar_item.rb +64 -60
  46. data/lib/ews/templates/forward_item.rb +19 -17
  47. data/lib/ews/templates/message.rb +61 -67
  48. data/lib/ews/templates/reply_to_item.rb +20 -18
  49. data/lib/ews/templates/task.rb +55 -55
  50. data/lib/ews/types/attachment.rb +75 -74
  51. data/lib/ews/types/attendee.rb +27 -25
  52. data/lib/ews/types/calendar_folder.rb +60 -44
  53. data/lib/ews/types/calendar_item.rb +134 -116
  54. data/lib/ews/types/contact.rb +11 -5
  55. data/lib/ews/types/contacts_folder.rb +10 -5
  56. data/lib/ews/types/copied_event.rb +47 -48
  57. data/lib/ews/types/created_event.rb +22 -20
  58. data/lib/ews/types/deleted_event.rb +22 -20
  59. data/lib/ews/types/distribution_list.rb +11 -5
  60. data/lib/ews/types/event.rb +60 -59
  61. data/lib/ews/types/export_items_response_message.rb +54 -50
  62. data/lib/ews/types/file_attachment.rb +63 -61
  63. data/lib/ews/types/folder.rb +58 -57
  64. data/lib/ews/types/free_busy_changed_event.rb +22 -20
  65. data/lib/ews/types/generic_folder.rb +348 -372
  66. data/lib/ews/types/item.rb +401 -397
  67. data/lib/ews/types/item_attachment.rb +87 -80
  68. data/lib/ews/types/item_field_uri_map.rb +201 -200
  69. data/lib/ews/types/mailbox_user.rb +146 -154
  70. data/lib/ews/types/meeting_cancellation.rb +11 -5
  71. data/lib/ews/types/meeting_message.rb +11 -5
  72. data/lib/ews/types/meeting_request.rb +11 -5
  73. data/lib/ews/types/meeting_response.rb +11 -5
  74. data/lib/ews/types/message.rb +11 -5
  75. data/lib/ews/types/modified_event.rb +43 -45
  76. data/lib/ews/types/moved_event.rb +47 -48
  77. data/lib/ews/types/new_mail_event.rb +22 -20
  78. data/lib/ews/types/out_of_office.rb +145 -144
  79. data/lib/ews/types/post_item.rb +11 -5
  80. data/lib/ews/types/search_folder.rb +10 -5
  81. data/lib/ews/types/status_event.rb +37 -36
  82. data/lib/ews/types/task.rb +39 -33
  83. data/lib/ews/types/tasks_folder.rb +32 -22
  84. data/lib/ews/types.rb +134 -139
  85. data/lib/viewpoint/logging/config.rb +19 -19
  86. data/lib/viewpoint/logging.rb +23 -17
  87. data/lib/viewpoint/string_utils.rb +31 -32
  88. data/lib/viewpoint.rb +18 -18
  89. metadata +82 -11
  90. data/Changelog.txt +0 -1004
@@ -1,70 +1,75 @@
1
- =begin
2
- This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
1
+ # frozen_string_literal: true
3
2
 
4
- Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
3
+ # This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
4
+ #
5
+ # Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
5
18
 
6
- Licensed under the Apache License, Version 2.0 (the "License");
7
- you may not use this file except in compliance with the License.
8
- You may obtain a copy of the License at
19
+ module Viewpoint
20
+ module EWS
21
+ module SOAP
22
+ # Parse the incoming response document via a SAX parser instead of the
23
+ # traditional DOM parser. In early benchmarks this was performing about
24
+ # 132% faster than the DOM-based parser for large documents.
25
+ class EwsSaxDocument < Nokogiri::XML::SAX::Document
26
+ include Viewpoint::EWS
27
+ include Viewpoint::StringUtils
9
28
 
10
- http://www.apache.org/licenses/LICENSE-2.0
29
+ attr_reader :struct
11
30
 
12
- Unless required by applicable law or agreed to in writing, software
13
- distributed under the License is distributed on an "AS IS" BASIS,
14
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- See the License for the specific language governing permissions and
16
- limitations under the License.
17
- =end
31
+ def initialize
32
+ super
33
+ @struct = {}
34
+ @elems = []
35
+ end
18
36
 
19
- module Viewpoint::EWS::SOAP
20
- # Parse the incoming response document via a SAX parser instead of the
21
- # traditional DOM parser. In early benchmarks this was performing about
22
- # 132% faster than the DOM-based parser for large documents.
23
- class EwsSaxDocument < Nokogiri::XML::SAX::Document
24
- include Viewpoint::EWS
25
- include Viewpoint::StringUtils
37
+ def characters(string)
38
+ # FIXME: Move white space removal to somewhere else.
39
+ # This function can be called multiple times. In this case newlines in Text Bodies get stripped.
40
+ # See: https://github.com/zenchild/Viewpoint/issues/90
41
+ # string.strip!
42
+ return if string.empty?
26
43
 
27
- attr_reader :struct
44
+ if @elems.last[:text]
45
+ @elems.last[:text] += string
46
+ else
47
+ @elems.last[:text] = string
48
+ end
49
+ end
28
50
 
29
- def initialize
30
- @struct = {}
31
- @elems = []
32
- end
33
-
34
- def characters(string)
35
- # FIXME: Move white space removal to somewhere else.
36
- # This function can be called multiple times. In this case newlines in Text Bodies get stripped.
37
- # See: https://github.com/zenchild/Viewpoint/issues/90
38
- #string.strip!
39
- return if string.empty?
40
- if @elems.last[:text]
41
- @elems.last[:text] += string
42
- else
43
- @elems.last[:text] = string
44
- end
45
- end
51
+ def start_element_namespace(name, attributes = [], _prefix = nil, _uri = nil, _namespaces = [])
52
+ ruby_case(name).to_sym
53
+ elem = {}
54
+ unless attributes.empty?
55
+ elem[:attribs] = attributes.collect { |a|
56
+ { ruby_case(a.localname).to_sym => a.value }
57
+ }.inject(&:merge)
58
+ end
59
+ @elems << elem
60
+ end
46
61
 
47
- def start_element_namespace(name, attributes = [], prefix = nil, uri = nil, ns = [])
48
- name = ruby_case(name).to_sym
49
- elem = {}
50
- unless attributes.empty?
51
- elem[:attribs] = attributes.collect{|a|
52
- { ruby_case(a.localname).to_sym => a.value}
53
- }.inject(&:merge)
62
+ def end_element_namespace(name, _prefix = nil, _uri = nil)
63
+ name = ruby_case(name).to_sym
64
+ elem = @elems.pop
65
+ if @elems.empty?
66
+ @struct[name] = elem
67
+ else
68
+ @elems.last[:elems] = [] unless @elems.last[:elems].is_a?(Array)
69
+ @elems.last[:elems] << { name => elem }
70
+ end
71
+ end
54
72
  end
55
- @elems << elem
56
73
  end
57
-
58
- def end_element_namespace name, prefix=nil, uri=nil
59
- name = ruby_case(name).to_sym
60
- elem = @elems.pop
61
- if @elems.empty?
62
- @struct[name] = elem
63
- else
64
- @elems.last[:elems] = [] unless @elems.last[:elems].is_a?(Array)
65
- @elems.last[:elems] << {name => elem}
66
- end
67
- end
68
-
69
74
  end
70
75
  end
@@ -1,74 +1,75 @@
1
- =begin
2
- This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
3
-
4
- Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
5
-
6
- Licensed under the Apache License, Version 2.0 (the "License");
7
- you may not use this file except in compliance with the License.
8
- You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing, software
13
- distributed under the License is distributed on an "AS IS" BASIS,
14
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- See the License for the specific language governing permissions and
16
- limitations under the License.
17
- =end
18
-
19
- module Viewpoint::EWS::SOAP
20
- class ResponseMessage
21
-
22
- attr_reader :message, :type
23
-
24
- def initialize(message)
25
- @type = message.keys.first
26
- @message = message[@type]
27
- end
28
-
29
- def response_class
30
- message[:attribs][:response_class]
31
- end
32
- alias :status :response_class
33
-
34
- def success?
35
- response_class == 'Success'
36
- end
37
-
38
- def message_text
39
- safe_hash_access message, [:elems, :message_text, :text]
40
- end
41
-
42
- def response_code
43
- safe_hash_access message, [:elems, :response_code, :text]
44
- end
45
- alias :code :response_code
46
-
47
- def message_xml
48
- safe_hash_access message, [:elems, :message_xml, :text]
49
- end
50
-
51
- def items
52
- safe_hash_access(message, [:elems, :items, :elems]) || []
53
- end
54
-
55
-
56
- private
57
-
58
-
59
- def safe_hash_access(hsh, keys)
60
- key = keys.shift
61
- return nil unless hsh.is_a?(Hash) && hsh.has_key?(key)
62
-
63
- if keys.empty?
64
- hsh[key]
65
- else
66
- safe_hash_access hsh[key], keys
1
+ # frozen_string_literal: true
2
+
3
+ # This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
4
+ #
5
+ # Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ module Viewpoint
20
+ module EWS
21
+ module SOAP
22
+ # Base class for parsed SOAP response messages.
23
+ class ResponseMessage
24
+ attr_reader :message, :type
25
+
26
+ def initialize(message)
27
+ @type = message.keys.first
28
+ @message = message[@type]
29
+ end
30
+
31
+ def response_class
32
+ message[:attribs][:response_class]
33
+ end
34
+ alias status response_class
35
+
36
+ def success?
37
+ response_class == 'Success'
38
+ end
39
+
40
+ def message_text
41
+ safe_hash_access message, %i[elems message_text text]
42
+ end
43
+
44
+ def response_code
45
+ safe_hash_access message, %i[elems response_code text]
46
+ end
47
+ alias code response_code
48
+
49
+ def message_xml
50
+ safe_hash_access message, %i[elems message_xml text]
51
+ end
52
+
53
+ def items
54
+ safe_hash_access(message, %i[elems items elems]) || []
55
+ end
56
+
57
+ private
58
+
59
+ def safe_hash_access(hsh, keys)
60
+ key = keys.shift
61
+ return nil unless hsh.is_a?(Hash) && hsh.key?(key)
62
+
63
+ if keys.empty?
64
+ hsh[key]
65
+ else
66
+ safe_hash_access hsh[key], keys
67
+ end
68
+ end
67
69
  end
68
70
  end
69
-
70
71
  end
71
- end # Viewpoint::EWS::SOAP
72
+ end
72
73
 
73
74
  require_relative './responses/create_item_response_message'
74
75
  require_relative './responses/create_attachment_response_message'
@@ -1,47 +1,47 @@
1
- =begin
2
- This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
3
-
4
- Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
5
-
6
- Licensed under the Apache License, Version 2.0 (the "License");
7
- you may not use this file except in compliance with the License.
8
- You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing, software
13
- distributed under the License is distributed on an "AS IS" BASIS,
14
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- See the License for the specific language governing permissions and
16
- limitations under the License.
17
- =end
18
-
19
- module Viewpoint::EWS::SOAP
20
-
21
- class CreateAttachmentResponseMessage < ResponseMessage
22
- include Viewpoint::StringUtils
23
-
24
- def attachments
25
- return @attachments if @attachments
26
-
27
- a = safe_hash_access message, [:elems, :attachments, :elems]
28
- @attachments = a.nil? ? nil : parse_attachments(a)
29
- end
30
-
31
-
32
- private
33
-
34
-
35
- def parse_attachments(att)
36
- att.collect do |a|
37
- type = a.keys.first
38
- klass = Viewpoint::EWS::Types.const_get(camel_case(type))
39
- item = OpenStruct.new
40
- item.ews = nil
41
- klass.new(item, a[type])
1
+ # frozen_string_literal: true
2
+
3
+ # This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
4
+ #
5
+ # Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ module Viewpoint
20
+ module EWS
21
+ module SOAP
22
+ # Parses the Create Attachment operation SOAP response.
23
+ class CreateAttachmentResponseMessage < ResponseMessage
24
+ include Viewpoint::StringUtils
25
+
26
+ def attachments
27
+ return @attachments if @attachments
28
+
29
+ a = safe_hash_access message, %i[elems attachments elems]
30
+ @attachments = a.nil? ? nil : parse_attachments(a)
31
+ end
32
+
33
+ private
34
+
35
+ def parse_attachments(att)
36
+ att.collect do |a|
37
+ type = a.keys.first
38
+ klass = Viewpoint::EWS::Types.const_get(camel_case(type))
39
+ item = OpenStruct.new
40
+ item.ews = nil
41
+ klass.new(item, a[type])
42
+ end
43
+ end
42
44
  end
43
45
  end
44
-
45
- end # CreateAttachmentResponseMessage
46
-
47
- end # Viewpoint::EWS::SOAP
46
+ end
47
+ end
@@ -1,25 +1,26 @@
1
- =begin
2
- This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
3
-
4
- Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
5
-
6
- Licensed under the Apache License, Version 2.0 (the "License");
7
- you may not use this file except in compliance with the License.
8
- You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing, software
13
- distributed under the License is distributed on an "AS IS" BASIS,
14
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- See the License for the specific language governing permissions and
16
- limitations under the License.
17
- =end
18
-
19
- module Viewpoint::EWS::SOAP
20
-
21
- class CreateItemResponseMessage < ResponseMessage
22
-
23
- end # CreateItemResponseMessage
24
-
25
- end # Viewpoint::EWS::SOAP
1
+ # frozen_string_literal: true
2
+
3
+ # This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
4
+ #
5
+ # Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ module Viewpoint
20
+ module EWS
21
+ module SOAP
22
+ class CreateItemResponseMessage < ResponseMessage
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,80 +1,78 @@
1
- =begin
2
- This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
3
-
4
- Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
5
-
6
- Licensed under the Apache License, Version 2.0 (the "License");
7
- you may not use this file except in compliance with the License.
8
- You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing, software
13
- distributed under the License is distributed on an "AS IS" BASIS,
14
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- See the License for the specific language governing permissions and
16
- limitations under the License.
17
- =end
18
-
19
- module Viewpoint::EWS::SOAP
20
-
21
- class RootFolder
22
-
23
- attr_reader :root
24
-
25
- def initialize(root)
26
- @root = root
27
- end
28
-
29
- def indexed_paging_offset
30
- attrib :index_paging_offset
31
- end
32
-
33
- def numerator_offset
34
- attrib :numerator_offset
35
- end
36
-
37
- def absolute_denominator
38
- attrib :absolute_denominator
39
- end
40
-
41
- def includes_last_item_in_range
42
- attrib :includes_last_item_in_range
43
- end
44
-
45
- def total_items_in_view
46
- attrib :total_items_in_view
47
- end
48
-
49
- def items
50
- root[:elems][0][:items][:elems] || []
51
- end
52
-
53
- def groups
54
- root[:elems][0][:groups][:elems]
55
- end
56
-
57
-
58
- private
59
-
60
-
61
- def attrib(key)
62
- return nil unless root.has_key?(:attribs)
63
- root[:attribs][key]
1
+ # frozen_string_literal: true
2
+
3
+ # This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
4
+ #
5
+ # Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ module Viewpoint
20
+ module EWS
21
+ module SOAP
22
+ # Root folder reference in FindItem responses.
23
+ class RootFolder
24
+ attr_reader :root
25
+
26
+ def initialize(root)
27
+ @root = root
28
+ end
29
+
30
+ def indexed_paging_offset
31
+ attrib :index_paging_offset
32
+ end
33
+
34
+ def numerator_offset
35
+ attrib :numerator_offset
36
+ end
37
+
38
+ def absolute_denominator
39
+ attrib :absolute_denominator
40
+ end
41
+
42
+ def includes_last_item_in_range
43
+ attrib :includes_last_item_in_range
44
+ end
45
+
46
+ def total_items_in_view
47
+ attrib :total_items_in_view
48
+ end
49
+
50
+ def items
51
+ root[:elems][0][:items][:elems] || []
52
+ end
53
+
54
+ def groups
55
+ root[:elems][0][:groups][:elems]
56
+ end
57
+
58
+ private
59
+
60
+ def attrib(key)
61
+ return nil unless root.key?(:attribs)
62
+
63
+ root[:attribs][key]
64
+ end
65
+ end
66
+
67
+ # Parses the Find Item operation SOAP response.
68
+ class FindItemResponseMessage < ResponseMessage
69
+ def root_folder
70
+ return @root_folder if @root_folder
71
+
72
+ rf = safe_hash_access message, %i[elems root_folder]
73
+ @root_folder = rf.nil? ? nil : RootFolder.new(rf)
74
+ end
75
+ end
64
76
  end
65
-
66
77
  end
67
-
68
-
69
- class FindItemResponseMessage < ResponseMessage
70
-
71
- def root_folder
72
- return @root_folder if @root_folder
73
-
74
- rf = safe_hash_access message, [:elems, :root_folder]
75
- @root_folder = rf.nil? ? nil : RootFolder.new(rf)
76
- end
77
-
78
- end # FindItemResponseMessage
79
-
80
- end # Viewpoint::EWS::SOAP
78
+ end