Class: Tilt::ErubiTemplate

Inherits:
Template
  • Object
show all
Defined in:
lib/tilt/erubi.rb

Overview

Erubi (a simplified version of Erubis) template implementation

Instance Method Summary collapse

Instance Method Details

#precompiled_template(locals) ⇒ Object



24
25
26
# File 'lib/tilt/erubi.rb', line 24

def precompiled_template(locals)
  @engine.src
end

#prepareObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/tilt/erubi.rb', line 8

def prepare
  @options.merge!(:preamble => false, :postamble => false, :ensure=>true)

  engine_class = if @options[:engine_class]
    @options[:engine_class]
  elsif @options[:capture]
    Erubi::CaptureEngine
  else
    Erubi::Engine
  end

  @engine = engine_class.new(data, @options)
  @outvar = @engine.bufvar
  @engine
end