Module: Sinatra::Helpers::Escape::XML

Extended by:
XML
Included in:
XML
Defined in:
lib/sinatra-helpers/escape/html.rb

Overview

XML escaping helpers.

Usage:

Include the module in your Sinatra application:

helpers ::Sinatra::Helpers::Escape::XML

Instance Method Summary collapse

Instance Method Details

#x(str) ⇒ String

Escapes the string so it’s safe to use in XML.

Parameters:

  • str (String)

    The string to escape.

Returns:

  • (String)

    Escaped version of the string.



63
64
65
# File 'lib/sinatra-helpers/escape/html.rb', line 63

def x( str )
	::Sinatra::Helpers::Escape::HTML.h( str )
end