Module: ActiveFulfillment::Parsing

Defined in:
lib/active_fulfillment/parsing.rb

Class Method Summary collapse

Class Method Details

.with_xml_document(xml, response = {}) {|document, response| ... } ⇒ Object

Yields:

  • (document, response)


5
6
7
8
9
10
11
12
13
# File 'lib/active_fulfillment/parsing.rb', line 5

def with_xml_document(xml, response = {})
  begin
    document = Nokogiri::XML(xml)
  rescue Nokogiri::XML::SyntaxError
    return response
  end

  yield document, response
end