Class Index [+]

Quicksearch

Erubis::XmlHelper

helper for xml

Constants

ESCAPE_TABLE

Public Instance Methods

escape_xml(value) click to toggle source
    # File lib/erubis/helper.rb, line 24
24:     def escape_xml(value)
25:       value.to_s.gsub(/[&<>"]/) { |s| ESCAPE_TABLE[s] }   # or /[&<>"']/
26:       #value.to_s.gsub(/[&<>"]/) { ESCAPE_TABLE[$&] }
27:     end
Also aliased as: h, html_escape
escape_xml2(value) click to toggle source
    # File lib/erubis/helper.rb, line 29
29:     def escape_xml2(value)
30:       return value.to_s.gsub(/\&/,'&amp;').gsub(/</,'&lt;').gsub(/>/,'&gt;').gsub(/"/,'&quot;')
31:     end
h(value) click to toggle source
Alias for: escape_xml
html_escape(value) click to toggle source
Alias for: escape_xml
u(str) click to toggle source
Alias for: url_encode
url_encode(str) click to toggle source
    # File lib/erubis/helper.rb, line 36
36:     def url_encode(str)
37:       return str.gsub(/[^-_.a-zA-Z0-9]+/) { |s|
38:         s.unpack('C*').collect { |i| "%%%02X" % i }.join
39:       }
40:     end
Also aliased as: u

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.