class HTTParty::YMXMLParser

Bug Fix for HTML encoded < and > in XML body. In order to parse the HTML encoded documents returned by the YourMembership API we need to HTML decode the <![CDATA[ tags.

@api private

Public Instance Methods

body() click to toggle source

@api private @override

# File lib/httparty/ym_xml_parser.rb, line 12
def body
  decode(@body)
end

Private Instance Methods

decode(body) click to toggle source

@api private

# File lib/httparty/ym_xml_parser.rb, line 19
def decode(body)
  # <![CDATA[ = &lt;![CDATA[
  # ]]> =  ]]&gt;
  if !body.nil? && body.include?('&lt;![CDATA[')
    body.gsub! '&lt;![CDATA[', '<![CDATA['
    body.gsub! ']]&gt;', ']]>'
  end
  body
end