Class: Tilt::MustacheTemplate

Inherits:
Template
  • Object
show all
Defined in:
lib/awestruct/handlers/template/mustache.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.engine_initialized?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/awestruct/handlers/template/mustache.rb', line 6

def self.engine_initialized?
  defined? ::Mustache
end

Instance Method Details

#allows_script?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/awestruct/handlers/template/mustache.rb', line 21

def allows_script?
  false
end

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



17
18
19
# File 'lib/awestruct/handlers/template/mustache.rb', line 17

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

#initialize_engineObject



10
11
12
# File 'lib/awestruct/handlers/template/mustache.rb', line 10

def initialize_engine
  require_template_library 'mustache'
end

#prepareObject



14
15
# File 'lib/awestruct/handlers/template/mustache.rb', line 14

def prepare
end