Sha256: cf97812824a82457b52a6b70af6d2855504464afb4fdd3be03dcfe0b28aad1bb

Contents?: true

Size: 574 Bytes

Versions: 3

Compression:

Stored size: 574 Bytes

Contents

module ChainReactor::Parsers
   
  # Parse the string using the xml simple library.
  class XmlSimpleParser < Parser

    require 'xmlsimple'

    # Parse an XML string, returning the result as a hash.
    #
    # Raises a ParseError on failure.
    def do_parse(string)
      begin
        @log.debug { "Parsing XML string #{string.inspect}" }
        XmlSimple.xml_in(string)
      rescue StandardError => e
        raise ParseError, "Data from client is not a valid XML string: #{string}, #{e.class.name} error: #{e.message}, data: #{string}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chain-reactor-0.2.2 lib/chain-reactor/parsers/xml_simple_parser.rb
chain-reactor-0.2.1 lib/chain-reactor/parsers/xml_simple_parser.rb
chain-reactor-0.2.0 lib/chain-reactor/parsers/xml_simple_parser.rb