The template source is evaluated as a Ruby string. The #{} interpolation syntax can be used to generated dynamic output.
# File lib/tilt/string.rb, line 16 def precompiled(locals) source, offset = super [source, offset + 1] end
# File lib/tilt/string.rb, line 12 def precompiled_template(locals) @code end
# File lib/tilt/string.rb, line 7 def prepare hash = "TILT#{data.hash.abs}" @code = String.new("<<#{hash}.chomp\n#{data}\n#{hash}") end