Class: AWS::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/AWS/responses.rb

Class Method Summary collapse

Class Method Details

.parse(options = {}) ⇒ Hash

Parse the XML response from AWS

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :xml (String)

    The XML response from AWS that we want to parse

  • :parse_options (Hash)

    Override the options for XmlSimple.

Returns:

  • (Hash)

    the input :xml converted to a custom Ruby Hash by XmlSimple.



10
11
12
13
14
15
16
# File 'lib/AWS/responses.rb', line 10

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