Object
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.
Create a new TextNode with the specified source.
# File lib/inversion/template/node.rb, line 18 def initialize( body, linenum=nil, colnum=nil ) @body = body @linenum = linenum @colnum = colnum end
Default (no-op) implementation of the after_appending callback. This exists so defining the append callbacks are optional for Node's subclasses.
# File lib/inversion/template/node.rb, line 77 def after_appending( state ) # Nothing to do return nil end
Default (no-op) implementation of the after_rendering callback. This exists so defining the rendering callbacks are optional for Node's subclasses.
# File lib/inversion/template/node.rb, line 95 def after_rendering( state=nil ) # Nothing to do return nil end
Render the node as a comment
# File lib/inversion/template/node.rb, line 44 def as_comment_body return self.inspect end
Default (no-op) implementation of the before_appending callback. This exists so defining the append callbacks are optional for Node's subclasses.
# File lib/inversion/template/node.rb, line 68 def before_appending( state ) # Nothing to do return nil end
Default (no-op) implementation of the before_rendering callback. This exists so defining the rendering callbacks are optional for Node's subclasses.
# File lib/inversion/template/node.rb, line 86 def before_rendering( state=nil ) # Nothing to do return nil end
Returns true if the node introduces a new parsing/rendering scope.
# File lib/inversion/template/node.rb, line 50 def is_container? return false end
Generated with the Darkfish Rdoc Generator 2.