Inversion::Template::ConfigTag

Inversion 'config' tag.

A tag that dynamically alters the behavior of the template.

Examples

<?config comment_start: /* ?>
<?config comment_end: */ ?>

<?config
    on_render_error: propagate
    debugging_comments: true
    comment_start: /*
    comment_end: */
?>

<?config { comment_start: "/*", comment_end: "*/" } ?>

Attributes

options[R]

The config options that will be modified

Public Class Methods

new( body, linenum=nil, colnum=nil ) click to toggle source

Create a new ConfigTag with the specified body.

# File lib/inversion/template/configtag.rb, line 34
def initialize( body, linenum=nil, colnum=nil )
        raise Inversion::ParseError, 'Empty config settings' if
                body.nil? || body.strip.empty?

        opts = YAML.load( body )
        @options = symbolify_keys( opts )

        super
end

Public Instance Methods

before_appending( parsestate ) click to toggle source

Override the options in the parsestate when the config is appended to the tree.

# File lib/inversion/template/configtag.rb, line 55
def before_appending( parsestate )
        parsestate.options.merge!( self.options )
end
before_rendering( renderstate ) click to toggle source

Override the options in the renderstate when the config is rendered.

# File lib/inversion/template/configtag.rb, line 61
def before_rendering( renderstate )
        renderstate.options.merge!( self.options )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.