Class: VertxWeb::ThymeleafTemplateEngine

Inherits:
TemplateEngine show all
Defined in:
/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/thymeleaf_template_engine.rb

Overview

A template engine that uses the Thymeleaf library.

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from TemplateEngine

#render

Class Method Details

+ (::VertxWeb::ThymeleafTemplateEngine) create

Create a template engine using defaults

Returns:

Raises:

  • (ArgumentError)


20
21
22
23
24
25
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/thymeleaf_template_engine.rb', line 20

def self.create
  if !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebTempl::ThymeleafTemplateEngine.java_method(:create, []).call(),::VertxWeb::ThymeleafTemplateEngine)
  end
  raise ArgumentError, "Invalid arguments when calling create()"
end

Instance Method Details

- (::VertxWeb::ThymeleafTemplateEngine) set_mode(mode = nil)

Set the mode for the engine

Parameters:

  • mode (:HTML, :XML, :TEXT, :JAVASCRIPT, :CSS, :RAW, :HTML5, :LEGACYHTML5, :XHTML, :VALIDXHTML, :VALIDXML) (defaults to: nil)
    the mode

Returns:

Raises:

  • (ArgumentError)


29
30
31
32
33
34
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/thymeleaf_template_engine.rb', line 29

def set_mode(mode=nil)
  if mode.class == Symbol && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setMode, [Java::OrgThymeleafTemplatemode::TemplateMode.java_class]).call(Java::OrgThymeleafTemplatemode::TemplateMode.valueOf(mode)),::VertxWeb::ThymeleafTemplateEngine)
  end
  raise ArgumentError, "Invalid arguments when calling set_mode(mode)"
end