Inversion::Template::ContainerTag

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

Attributes

subnodes[R]

The nodes the tag contains

Public Class Methods

new( * ) click to toggle source

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

<<( node ) click to toggle source

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
container?() click to toggle source
Alias for: is_container?
is_container?() click to toggle source

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?
render( renderstate ) click to toggle source

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
render_subnodes( renderstate ) click to toggle source

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.