Class: Exchanger::GetAttachment::Request

Inherits:
Operation::Request show all
Defined in:
lib/exchanger/operations/get_attachment.rb

Instance Attribute Summary collapse

Attributes inherited from Operation::Request

#body, #response

Instance Method Summary collapse

Methods inherited from Operation::Request

#action, #headers, #initialize

Constructor Details

This class inherits a constructor from Exchanger::Operation::Request

Instance Attribute Details

#attachment_idsObject

Returns the value of attribute attachment_ids


7
8
9
# File 'lib/exchanger/operations/get_attachment.rb', line 7

def attachment_ids
  @attachment_ids
end

#base_shapeObject

Returns the value of attribute base_shape


7
8
9
# File 'lib/exchanger/operations/get_attachment.rb', line 7

def base_shape
  @base_shape
end

Instance Method Details

#resetObject

Reset request options to defaults.


10
11
12
13
# File 'lib/exchanger/operations/get_attachment.rb', line 10

def reset
  @attachment_ids = []
  @base_shape = :all_properties
end

#to_xmlObject


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/exchanger/operations/get_attachment.rb', line 15

def to_xml
  Nokogiri::XML::Builder.new do |xml|
    xml.send("soap:Envelope", "xmlns:soap" => NS["soap"]) do
      xml.send("soap:Body") do
        xml.GetAttachment("xmlns" => NS["m"], "xmlns:t" => NS["t"]) do
          xml.AttachmentShape do
            xml.send "t:BaseShape", base_shape.to_s.camelize
          end
          xml.AttachmentIds do
            attachment_ids.each do |attachment_id|
              xml.send("t:AttachmentId", "Id" => attachment_id)
            end
          end
        end
      end
    end
  end
end