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

.xml_escape(s) ⇒ Object



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