Method: Arrow::Template::SetDirective#render

Defined in:
lib/arrow/template/set.rb

#render(template, scope) ⇒ Object

Render the directive. This adds the defined variable to the template‘s rendering scope and returns an empty string (or a comment if :debuggingComments is turned on in the template.



51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/arrow/template/set.rb', line 51

def render( template, scope )
	rval = super

	self.log.debug "Evaling <%s> for 'set' directive." % @value
	template[@name] = eval( @value, scope.get_binding, __FILE__, __LINE__ )

	if template._config[:debuggingComments]
		rval << template.render_comment( "Set '%s' to '%s'" %
			[ @name, template[@name] ] )
	end

	return rval
end