Class: Arrow::Template::RenderDirective
- Inherits:
-
AttributeDirective
- Object
- Object
- Node
- Directive
- AttributeDirective
- Arrow::Template::RenderDirective
- Includes:
- Parser::Patterns
- Defined in:
- lib/arrow/template/render.rb
Overview
The Arrow::Template::RenderDirective class, a derivative of Arrow::Template::Directive. This is the class which defines the behaviour of the ‘render’ template directive.
Syntax
<?render foo as bar in baz.tmpl ?>
VCS Id
$Id$
Authors
-
Michael Granger <[email protected]>
Please see the file LICENSE in the top-level directory for licensing details.
Constant Summary collapse
- AS =
Parse tokens
/\s+as\s+/i
- IN =
/in/i
Constants included from Parser::Patterns
Parser::Patterns::ALTERNATION, Parser::Patterns::ARGDEFAULT, Parser::Patterns::ARGUMENT, Parser::Patterns::CAPTURE, Parser::Patterns::COMMA, Parser::Patterns::DBLQSTRING, Parser::Patterns::DOT, Parser::Patterns::EQUALS, Parser::Patterns::IDENTIFIER, Parser::Patterns::INFIX, Parser::Patterns::LBRACKET, Parser::Patterns::NUMBER, Parser::Patterns::PATHNAME, Parser::Patterns::QUOTEDSTRING, Parser::Patterns::RBRACKET, Parser::Patterns::REBINDOP, Parser::Patterns::REGEXP, Parser::Patterns::SLASHQSTRING, Parser::Patterns::SYMBOL, Parser::Patterns::TAGCLOSE, Parser::Patterns::TAGMIDDLE, Parser::Patterns::TAGOPEN, Parser::Patterns::TICKQSTRING, Parser::Patterns::VARIABLE, Parser::Patterns::WHITESPACE
Constants inherited from AttributeDirective
AttributeDirective::SVNId, AttributeDirective::SVNRev
Constants inherited from Directive
Directive::SVNId, Directive::SVNRev
Constants inherited from Node
Constants included from HTMLUtilities
HTMLUtilities::ARRAY_HTML_CONTAINER, HTMLUtilities::HASH_HTML_CONTAINER, HTMLUtilities::HASH_PAIR_HTML, HTMLUtilities::IMMEDIATE_OBJECT_HTML_CONTAINER, HTMLUtilities::IVAR_HTML_FRAGMENT, HTMLUtilities::OBJECT_HTML_CONTAINER, HTMLUtilities::THREAD_DUMP_KEY
Instance Attribute Summary collapse
-
#subtemplate ⇒ Object
readonly
An Array of Regexp objects which match the names of attributes to be rendered.
Attributes inherited from AttributeDirective
Attributes inherited from Node
Class Method Summary collapse
-
.allows_format? ⇒ Boolean
Disallow formats.
Instance Method Summary collapse
-
#initialize(type, parser, state) ⇒ RenderDirective
constructor
Create a new RenderDirective object.
-
#inspect ⇒ Object
Return a human-readable version of the object suitable for debugging messages.
Methods inherited from AttributeDirective
#before_rendering, #is_rendering_node?, #render, #to_html
Methods inherited from Directive
create, derivativeDirs, #render, #to_html
Methods inherited from Node
#add_to_template, #is_rendering_node?, #render, #to_a, #to_html, #to_s
Methods included from HTMLUtilities
escape_html, make_html_for_object, make_object_html_wrapper
Methods inherited from Object
deprecate_class_method, deprecate_method, inherited
Constructor Details
#initialize(type, parser, state) ⇒ RenderDirective
Create a new RenderDirective object.
46 47 48 49 50 51 52 53 |
# File 'lib/arrow/template/render.rb', line 46 def initialize( type, parser, state ) @target = nil @subtemplate = nil state[:templateCache] ||= {} super end |
Instance Attribute Details
#subtemplate ⇒ Object (readonly)
An Array of Regexp objects which match the names of attributes to be rendered.
62 63 64 |
# File 'lib/arrow/template/render.rb', line 62 def subtemplate @subtemplate end |
Class Method Details
.allows_format? ⇒ Boolean
Disallow formats
38 |
# File 'lib/arrow/template/render.rb', line 38 def self::allows_format?; false; end |
Instance Method Details
#inspect ⇒ Object
Return a human-readable version of the object suitable for debugging messages.
67 68 69 70 71 72 73 74 75 |
# File 'lib/arrow/template/render.rb', line 67 def inspect %Q{<%s %s%s as %s in %s>} % [ @type.capitalize, @name, @methodchain.strip.empty? ? "" : "." + @methodchain, @target, @subtemplate._file, ] end |