YieldTag class

Inversion ‘yield’ tag.

A tag that yields to the block passed to Template#render (if there was one), and then inserts the resulting objects.


<?yield ?>

Public Instance Methods

before_rendering( renderstate )

Rendering callback – call the block before the template this tag belongs to is rendered.

# File lib/inversion/template/yieldtag.rb, line 26
def before_rendering( renderstate )
        if renderstate.block
                self.log.debug "Yielding to %p before rendering." % [ renderstate.block ]
                renderstate.tag_data[ self ] = renderstate )
                self.log.debug "  render block returned: %p" % [ @block_value ]
render( renderstate )

Render the YieldTag by returning what the render block returned during before_rendering (if there was a block).

# File lib/inversion/template/yieldtag.rb, line 37
def render( renderstate )
        self.log.debug "Rendering as block return value: %p" % [ @block_value ]
        return renderstate.tag_data[ self ]