Class Tilt::StringTemplate
In: lib/tilt/string.rb
Parent: Template

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

Methods

Public Instance methods

[Source]

    # File lib/tilt/string.rb, line 16
16:     def precompiled(locals)
17:       source, offset = super
18:       [source, offset + 1]
19:     end

[Source]

    # File lib/tilt/string.rb, line 12
12:     def precompiled_template(locals)
13:       @code
14:     end

[Source]

    # File lib/tilt/string.rb, line 7
 7:     def prepare
 8:       hash = "TILT#{data.hash.abs}"
 9:       @code = "<<#{hash}.chomp\n#{data}\n#{hash}"
10:     end

[Validate]