ConfigTag

class
Superclass
Inversion::Template::Tag
Included Modules
Inversion::HashUtilities

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

anchor
new( body, linenum=nil, colnum=nil )

Create a new ConfigTag with the specified body.

# File lib/inversion/template/configtag.rb, line 33
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

anchor
before_appending( parsestate )

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

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

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

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