viewpoint 0.1.19 → 0.1.20

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.
@@ -70,7 +70,7 @@ module Viewpoint
70
70
  resp = (Viewpoint::EWS::EWS.instance).ews.find_folder( [normalize_id(root)], traversal, {:base_shape => shape} )
71
71
  else
72
72
  restr = {:restriction =>
73
- {:is_equal_to => {:field_uRI => {:field_uRI=>'folder:FolderClass'},:field_uRI_or_constant=>{:constant => {:value => folder_type}}}}
73
+ {:is_equal_to => [{:field_uRI => {:field_uRI=>'folder:FolderClass'}}, {:field_uRI_or_constant=>{:constant => {:value => folder_type}}}]}
74
74
  }
75
75
  resp = (Viewpoint::EWS::EWS.instance).ews.find_folder( [normalize_id(root)], traversal, {:base_shape => shape}, restr)
76
76
  end
@@ -305,7 +305,7 @@ module Viewpoint
305
305
  if(resp.status == 'Success')
306
306
  item = resp.items.shift
307
307
  type = item.keys.first
308
- return eval "#{type.to_s.camel_case}.new(item[type])"
308
+ eval "#{type.to_s.camel_case}.new(item[type])"
309
309
  else
310
310
  raise EwsError, "Could not retrieve item. #{resp.code}: #{resp.message}"
311
311
  end
@@ -37,9 +37,13 @@ module Viewpoint
37
37
  def self.get_item(item_id, shape = :default)
38
38
  item_shape = {:base_shape => shape.to_s.camelcase}
39
39
  resp = (Viewpoint::EWS::EWS.instance).ews.get_item([item_id], item_shape)
40
- resp = resp.items.shift
41
- resp_type = resp.keys.first
42
- eval "#{resp_type.to_s.camel_case}.new(resp[resp_type])"
40
+ if(resp.status == 'Success')
41
+ item = resp.items.shift
42
+ type = item.keys.first
43
+ eval "#{type.to_s.camel_case}.new(item[type])"
44
+ else
45
+ raise EwsError, "Could not retrieve item. #{resp.code}: #{resp.message}"
46
+ end
43
47
  end
44
48
 
45
49
  # Add attachments to the passed in ParentId
@@ -93,7 +93,9 @@ module Viewpoint
93
93
 
94
94
  def get_item_response(opts)
95
95
  if(@response_message.status == 'Success')
96
- @response_message.items << xml_to_hash!((@response/"//#{NS_EWS_MESSAGES}:Items/*").first.native_element)
96
+ (@response/"//#{NS_EWS_MESSAGES}:Items/*").each do |item|
97
+ @response_message.items << xml_to_hash!(item.native_element)
98
+ end
97
99
  else
98
100
  raise EwsError, "#{@response_message.code}: #{@response_message.message}"
99
101
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: viewpoint
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.19
5
+ version: 0.1.20
6
6
  platform: ruby
7
7
  authors:
8
8
  - Dan Wanek
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-26 00:00:00 -06:00
13
+ date: 2011-03-08 00:00:00 -06:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency