Class: Ember::Emblem::Template

Inherits:
Handlebars::Template
  • Object
show all
Defined in:
lib/ember/emblem/template.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.setup(env) ⇒ Object



13
14
15
# File 'lib/ember/emblem/template.rb', line 13

def self.setup(env)
  env.register_engine '.emblem', self
end

Instance Method Details

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



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ember/emblem/template.rb', line 17

def evaluate(scope, locals, &block)
  template = data

  if config.precompile
    template = precompile_ember_emblem(template, config.ember_template)
  else
    template = compile_ember_emblem(template, config.ember_template)
  end

  target = global_template_target(scope.logical_path, config)
  "#{target} = #{template}\n"
end