Module: Thymeleaf::Processor

Instance Method Summary collapse

Instance Method Details

#evaluate_in_context(context, expr) ⇒ Object



8
9
10
# File 'lib/thymeleaf/processor.rb', line 8

def evaluate_in_context(context, expr)
  ContextEvaluator.new(context).evaluate(expr)
end

#load_template(template_name) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/thymeleaf/processor.rb', line 17

def load_template(template_name)
  template_uri = Thymeleaf.configuration.template_uri(template_name)

  File.open template_uri do |template_file|
    template_file.rewind
    yield template_file.read
  end
end

#subprocess_node(context, node) ⇒ Object



12
13
14
15
# File 'lib/thymeleaf/processor.rb', line 12

def subprocess_node(context, node)
  processor = Thymeleaf::TemplateEngine.new
  processor.send(:process_node, context, node)
end