Inversion::Template::
Node class
Superclass | Object |
Included Modules | |
Extended With |
|
Inversion
template node base class. Template text is parsed by the Inversion::Parser
into nodes, and appended to a tree that is later walked when the template is rendered.
This class is abstract; it just defines the API that other nodes are expected to implement.
Attributes
- colnum R
The column number the node was parsed from in the template source (if known)
- linenum R
The line number the node was parsed from in the template source (if known)
Public Class Methods
Create a new TextNode with the specified ‘source`.
Public Instance Methods
Default (no-op) implementation of the after_appending
callback. This exists so defining the append callbacks are optional for Node’s subclasses.
Default (no-op) implementation of the after_rendering
callback. This exists so defining the rendering callbacks are optional for Node’s subclasses.
Render the node as a comment
Default (no-op) implementation of the before_appending
callback. This exists so defining the append callbacks are optional for Node’s subclasses.
Default (no-op) implementation of the before_rendering
callback. This exists so defining the rendering callbacks are optional for Node’s subclasses.
Returns ‘true` if the node introduces a new parsing/rendering scope.
Return the location of the tag in the template, if it was parsed from one (i.e., if it was created with a StringScanner)
Render the node using the given ‘render_state`. By default, rendering a node returns `nil`.