Inversion::Template::

ContainerTag module

A mixin for a tag that allows it to contain other nodes.

Attributes

subnodes R

The nodes the tag contains

Public Class Methods

new( * ) { |self| ... }

Setup subnodes for including classes. :notnew:

# File lib/inversion/template/containertag.rb, line 9
def initialize( * )
        @subnodes = []
        super
        yield( self ) if block_given?
end

Public Instance Methods

<<( node )

Append operator: add nodes to the correct part of the parse tree.

# File lib/inversion/template/containertag.rb, line 21
def <<( node )
        @subnodes << node
        return self
end
container?()
Alias for: is_container?
is_container?()

Tell the parser to expect a matching <?end ?> tag.

# File lib/inversion/template/containertag.rb, line 28
def is_container?
        return true
end
Also aliased as: container?
render( renderstate )

Default render method for containertags; rendering each of its subnodes and don’t render anything for the container itself.

# File lib/inversion/template/containertag.rb, line 36
def render( renderstate )
        self.render_subnodes( renderstate )
end
render_subnodes( renderstate )

Append the container’s subnodes to the ‘renderstate`.

# File lib/inversion/template/containertag.rb, line 42
def render_subnodes( renderstate )
        self.subnodes.each {|node| renderstate << node }
end