Class: EC2::Response

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

Class Method Summary collapse

Class Method Details

.parse(options = {}) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/EC2/responses.rb', line 47

def self.parse(options = {})
  options = {
    :xml => "",
    :parse_options => { 'ForceArray' => ['item'], 'SuppressEmpty' => nil }
  }.merge(options)

  # NOTE: Parsing the response as a nested set of Response objects was extremely
  # memory intensive and appeared to leak (the memory was not freed on subsequent requests).
  # It was changed to return the raw XmlSimple response.

  response = XmlSimple.xml_in(options[:xml], options[:parse_options])

  return response
end