Module: Cheri::Xml::XmlBuilder

Included in:
CommentElem, Elem, EmptyElem, TextElem, XmlRoot
Defined in:
lib/cheri/builder/xml/element.rb

Overview

Included by all Cheri::Xml builders

Constant Summary collapse

TCE =

:nodoc:

' />'.freeze

Instance Method Summary collapse

Instance Method Details

#empty_io(ios) ⇒ Object



41
42
43
# File 'lib/cheri/builder/xml/element.rb', line 41

def empty_io(ios)
  ios << TCE
end

#empty_s(str = '') ⇒ Object



37
38
39
# File 'lib/cheri/builder/xml/element.rb', line 37

def empty_s(str='')
  str << TCE
end

#esc(inp, out = nil) ⇒ Object



45
46
47
48
49
50
51
52
53
54
# File 'lib/cheri/builder/xml/element.rb', line 45

def esc(inp,out=nil)
  if @opt[:esc] && (cs = Charsets.charset(inp))
    cs.xlat(inp,(out ||= ''))
    out
  elsif out
    out << inp
  else
    inp
  end
end