Class: Spirit::Tilt::Template

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/spirit/tilt/template.rb

Overview

Template adapter for Tilt. This class depends on the tilt gem.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.engine_initialized?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/spirit/tilt/template.rb', line 14

def self.engine_initialized?
  defined? Spirit::Render and defined? Spirit::Render::HTML
end

Instance Method Details

#allows_script?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/spirit/tilt/template.rb', line 27

def allows_script?
  false
end

#evaluate(scope, locals, &block) ⇒ Object



23
24
25
# File 'lib/spirit/tilt/template.rb', line 23

def evaluate(scope, locals, &block)
  @output ||= @engine.render
end

#prepareObject



18
19
20
21
# File 'lib/spirit/tilt/template.rb', line 18

def prepare
  @engine = Spirit::Document.new data, options
  @output = nil
end