Inversion::Template::
CommentTag
class
Inversion
‘comment’ tag.
This tag hides its contents from the rendered output.
<?comment ?><?end?>
<?comment Disabled for now ?>
<?attr some_hidden_attribute ?>
<?end comment ?>
Render the tag as the body of a comment, suitable for template debugging.
def as_comment_body
firstnode, lastnode = self.subnodes.first, self.subnodes.last
nodecount = self.subnodes.length
linedesc = if firstnode.linenum == lastnode.linenum
"on line %d" % [ firstnode.linenum ]
else
"from line %d to %d" % [ firstnode.linenum, lastnode.linenum ]
end
return "Commented out %d nodes %s%s" % [
nodecount,
linedesc,
self.body.empty? ? '' : ': ' + self.body,
]
end
Render (or don’t render, actually) the comment’s subnodes.
def render( state )
return ''
end