Class: Exchanger::MoveItem::Request
- Inherits:
-
Operation::Request
- Object
- Operation::Request
- Exchanger::MoveItem::Request
- Defined in:
- lib/exchanger/operations/move_item.rb
Instance Attribute Summary collapse
-
#folder_id ⇒ Object
Returns the value of attribute folder_id.
-
#items ⇒ Object
Returns the value of attribute items.
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
#folder_id ⇒ Object
Returns the value of attribute folder_id.
7 8 9 |
# File 'lib/exchanger/operations/move_item.rb', line 7 def folder_id @folder_id end |
#items ⇒ Object
Returns the value of attribute items.
7 8 9 |
# File 'lib/exchanger/operations/move_item.rb', line 7 def items @items end |
Instance Method Details
#reset ⇒ Object
Reset request options to defaults.
10 11 12 |
# File 'lib/exchanger/operations/move_item.rb', line 10 def reset @items = [] end |
#to_xml ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/exchanger/operations/move_item.rb', line 14 def to_xml Nokogiri::XML::Builder.new do |xml| xml.send("soap:Envelope", "xmlns:soap" => NS["soap"], "xmlns:t" => NS["t"], "xmlns:xsi" => NS["xsi"], "xmlns:xsd" => NS["xsd"]) do xml.send("soap:Body") do xml.MoveItem("xmlns" => NS["m"], "xmlns:t" => NS["t"]) do xml.ToFolderId do if folder_id.is_a?(Symbol) xml.send("t:DistinguishedFolderId", "Id" => folder_id) else xml.send("t:FolderId", "Id" => folder_id) end end xml.ItemIds do items.each do |item| xml.send "t:ItemId", {"Id" => item.id, "ChangeKey" => item.change_key} end end end end end end end |