Class: FakeSQS::Responder

Inherits:
Object
  • Object
show all
Defined in:
lib/fake_sqs/responder.rb

Instance Method Summary collapse

Instance Method Details

#call(name, &block) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/fake_sqs/responder.rb', line 7

def call(name, &block)
  xml = Builder::XmlMarkup.new(:indent => 4)
  xml.tag! "#{name}Response" do
    if block
      xml.tag! "#{name}Result" do
        yield xml
      end
    end
    xml.ResponseMetadata do
      xml.RequestId SecureRandom.uuid
    end
  end
end