File: responses.rb

package info (click to toggle)
ruby-amazon-ec2 0.9.17-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,232 kB
  • sloc: ruby: 4,659; makefile: 5
file content (21 lines) | stat: -rw-r--r-- 651 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module AWS

  class Response

    # Parse the XML response from AWS
    #
    # @option options [String] :xml The XML response from AWS that we want to parse
    # @option options [Hash] :parse_options Override the options for XmlSimple.
    # @return [Hash] the input :xml converted to a custom Ruby Hash by XmlSimple.
    def self.parse(options = {})
      options = {
        :xml => "",
        :parse_options => { 'forcearray' => ['item', 'member'], 'suppressempty' => nil, 'keeproot' => false }
      }.merge(options)
      response = XmlSimple.xml_in(options[:xml], options[:parse_options])
    end

  end  # class Response

end  # module AWS