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

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

Setup subnodes for including classes. :notnew:

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

Public Instance Methods

anchor
<<( node )

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

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

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

# File lib/inversion/template/containertag.rb, line 30
def is_container?
        return true
end
Also aliased as: container?
anchor
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 38
def render( renderstate )
        self.render_subnodes( renderstate )
end
anchor
render_subnodes( renderstate )

Append the container's subnodes to the renderstate.

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