Class: SPImaging::ShowImagesRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/spimaging/show_images_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuids) ⇒ ShowImagesRequest

Returns a new instance of ShowImagesRequest.



7
8
9
# File 'lib/spimaging/show_images_request.rb', line 7

def initialize(uuids)
  self.uuids = uuids
end

Instance Attribute Details

#uuidsObject

Returns the value of attribute uuids.



5
6
7
# File 'lib/spimaging/show_images_request.rb', line 5

def uuids
  @uuids
end

#xmlObject

Returns the value of attribute xml.



5
6
7
# File 'lib/spimaging/show_images_request.rb', line 5

def xml
  @xml
end

Instance Method Details

#downloadObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/spimaging/show_images_request.rb', line 11

def download

  builder = Nokogiri::XML::Builder.new :encoding => 'utf-8' do |xml|
    # Clients that treat this as a real builder sometimes need to call 'tag!'
    # That's ok.
    def xml.tag!(*args, &bl)
      # Handle reserved names correctly
      name = args.shift + '_'
      send name, *args, &bl
    end

    xml.spimaging do
      xml.uuids do
        uuids.each do | uuid |
          xml.uuid(uuid)
        end
      end
    end
  end

  @xml = builder.to_xml
  SPImaging::Protocol.instance.download_images @xml
end