Class: XmlSimple

Inherits:
Object
  • Object
show all
Defined in:
lib/jasper_server/protocols/soap.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.xml_in_string(string, options = nil) ⇒ Object



23
24
25
# File 'lib/jasper_server/protocols/soap.rb', line 23

def self.xml_in_string(string, options = nil)
  new.xml_in_string(string, options)
end

Instance Method Details

#xml_in_string(string, options = nil) ⇒ Object

Same as xml_in but doesn’t try to smartly shoot itself in the foot.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/jasper_server/protocols/soap.rb', line 10

def xml_in_string(string, options = nil)
  handle_options('in', options)

  @doc = parse(string)
  result = collapse(@doc.root)

  if @options['keeproot']
    merge({}, @doc.root.name, result)
  else
    result
  end
end