Class: Inversion::Template::EscapeTag

Inherits:
AttrTag show all
Includes:
Escaping
Defined in:
lib/inversion/template/escapetag.rb

Overview

Inversion escaping tag.

This tag is a derivative of the ‘attr’ tag that escapes the results of its method call via the format specified in the template config option ‘escape_format’.

Syntax

<?escape foo.bar ?>
<?escape "Got <%d> items at <$%0.2f>" % [ line_item.count, line_item.price ] ?>

Constant Summary

Constants included from Escaping

Escaping::DEFAULT_ESCAPE_FORMAT, Escaping::URI_ENCODED_CHARACTERS

Constants inherited from Tag

Tag::TAG_PLUGIN_PATTERN

Instance Attribute Summary

Attributes inherited from AttrTag

#format, #methodchain, #name

Attributes inherited from CodeTag

#body, #identifiers

Attributes inherited from Tag

#body

Attributes inherited from Node

#colnum, #linenum

Instance Method Summary collapse

Methods included from Escaping

#escape, #escape_html, #escape_uri, included

Methods inherited from AttrTag

#as_comment_body, #evaluate, #initialize

Methods inherited from CodeTag

inherit_tag_patterns, #initialize, tag_pattern, tag_patterns

Methods included from AbstractClass

included

Methods included from AbstractClass::ClassMethods

#inherited, #pure_virtual

Methods inherited from Tag

#as_comment_body, create, #derivatives, inherited, #initialize, load, load_all, #tagname, types, #types

Methods included from MethodUtilities

#singleton_attr_accessor, #singleton_attr_reader, #singleton_attr_writer

Methods inherited from Node

#after_appending, #after_rendering, #as_comment_body, #before_appending, #before_rendering, #initialize, #is_container?, #location

Constructor Details

This class inherits a constructor from Inversion::Template::AttrTag

Instance Method Details

#render(render_state) ⇒ Object

Render the method chains against the attributes of the specified ‘render_state` and return them.



22
23
24
# File 'lib/inversion/template/escapetag.rb', line 22

def render( render_state )
	return self.escape( super, render_state )
end