class Tilt::StringTemplate

The template source is evaluated as a Ruby string. The #{} interpolation syntax can be used to generated dynamic output.

Public Instance Methods

precompiled(locals) click to toggle source
Calls superclass method Template#precompiled
# File lib/tilt/string.rb, line 16
def precompiled(locals)
  source, offset = super
  [source, offset + 1]
end
precompiled_template(locals) click to toggle source
# File lib/tilt/string.rb, line 12
def precompiled_template(locals)
  @code
end
prepare() click to toggle source
# File lib/tilt/string.rb, line 7
def prepare
  hash = "TILT#{data.hash.abs}"
  @code = String.new("<<#{hash}.chomp\n#{data}\n#{hash}")
end