Class: Stratus::AWS::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/stratus/aws/iam.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.



23
24
25
26
27
28
29
# File 'lib/stratus/aws/iam.rb', line 23

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