Class: Cheri::Xml::EscElem

Inherits:
TextElem show all
Defined in:
lib/cheri/builder/xml/element.rb

Overview

Like TextElem, but always escapes values, regardless of :esc setting

Constant Summary

Constants included from XmlBuilder

XmlBuilder::TCE

Instance Method Summary collapse

Methods inherited from TextElem

#initialize, #mod, #to_io, #to_s

Methods included from XmlBuilder

#empty_io, #empty_s

Constructor Details

This class inherits a constructor from Cheri::Xml::TextElem

Instance Method Details

#esc(inp, out = nil) ⇒ Object



162
163
164
165
166
167
168
169
170
171
# File 'lib/cheri/builder/xml/element.rb', line 162

def esc(inp,out=nil)
  if (cs = Charsets.charset(inp))
    cs.xlat(inp,(out ||= ''))
    out
  elsif out
    out << inp
  else
    inp
  end
end