Class: Exchanger::FindItem::Request
- Inherits:
-
Operation::Request
- Object
- Operation::Request
- Exchanger::FindItem::Request
- Defined in:
- lib/exchanger/operations/find_item.rb
Instance Attribute Summary collapse
-
#base_shape ⇒ Object
Returns the value of attribute base_shape.
-
#calendar_view ⇒ Object
Returns the value of attribute calendar_view.
-
#email_address ⇒ Object
Returns the value of attribute email_address.
-
#folder_id ⇒ Object
Returns the value of attribute folder_id.
-
#traversal ⇒ Object
Returns the value of attribute traversal.
Attributes inherited from Operation::Request
Instance Method Summary collapse
-
#reset ⇒ Object
Reset request options to defaults.
- #to_xml ⇒ Object
Methods inherited from Operation::Request
#action, #headers, #initialize
Constructor Details
This class inherits a constructor from Exchanger::Operation::Request
Instance Attribute Details
#base_shape ⇒ Object
Returns the value of attribute base_shape.
7 8 9 |
# File 'lib/exchanger/operations/find_item.rb', line 7 def base_shape @base_shape end |
#calendar_view ⇒ Object
Returns the value of attribute calendar_view.
7 8 9 |
# File 'lib/exchanger/operations/find_item.rb', line 7 def calendar_view @calendar_view end |
#email_address ⇒ Object
Returns the value of attribute email_address.
7 8 9 |
# File 'lib/exchanger/operations/find_item.rb', line 7 def email_address @email_address end |
#folder_id ⇒ Object
Returns the value of attribute folder_id.
7 8 9 |
# File 'lib/exchanger/operations/find_item.rb', line 7 def folder_id @folder_id end |
#traversal ⇒ Object
Returns the value of attribute traversal.
7 8 9 |
# File 'lib/exchanger/operations/find_item.rb', line 7 def traversal @traversal end |
Instance Method Details
#reset ⇒ Object
Reset request options to defaults.
10 11 12 13 14 15 16 |
# File 'lib/exchanger/operations/find_item.rb', line 10 def reset @folder_id = :contacts @traversal = :shallow @base_shape = :all_properties @email_address = nil @calendar_view = nil end |
#to_xml ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/exchanger/operations/find_item.rb', line 18 def to_xml Nokogiri::XML::Builder.new do |xml| xml.send("soap:Envelope", "xmlns:soap" => NS["soap"]) do xml.send("soap:Body") do xml.FindItem("xmlns" => NS["m"], "xmlns:t" => NS["t"], "Traversal" => traversal.to_s.camelize) do xml.ItemShape do xml.send "t:BaseShape", base_shape.to_s.camelize end if calendar_view xml.CalendarView(calendar_view.to_xml.attributes) end xml.ParentFolderIds do if folder_id.is_a?(Symbol) xml.send("t:DistinguishedFolderId", "Id" => folder_id) do if email_address xml.send("t:Mailbox") do xml.send("t:EmailAddress", email_address) end end end else xml.send("t:FolderId", "Id" => folder_id) end end end end end end end |