Module: Handsoap::XmlMason

Defined in:
lib/handsoap/xml_mason.rb

Overview

XmlMason is a simple XML builder.

Defined Under Namespace

Classes: Document, Element, Node, RawContent, TextNode

Constant Summary

XML_ESCAPE =
{ '&' => '&amp;', '"' => '&quot;', '>' => '&gt;', '<' => '&lt;' }

Class Method Summary (collapse)

Class Method Details

+ (Object) xml_escape(s)



10
11
12
# File 'lib/handsoap/xml_mason.rb', line 10

def self.xml_escape(s)
  s.to_s.gsub(/[&"><]/) { |special| XML_ESCAPE[special] }
end