Class List Method List File List

# Class: VertxWeb::TemplateEngine

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

## Direct Known Subclasses

FreeMarkerTemplateEngine, HandlebarsTemplateEngine, JadeTemplateEngine, MVELTemplateEngine, PebbleTemplateEngine, ThymeleafTemplateEngine

## Instance Method Summary (collapse)

- - (TemplateEngine) initialize(j_del) constructor
  A new instance of TemplateEngine.
- - (Object) j_del
- - (Object) render(context = nil, templateFileName = nil)

## Constructor Details

### - (`TemplateEngine`) initialize(j_del)

Returns a new instance of TemplateEngine

    12
    13
    14
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/template_engine.rb', line 12

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) j_del

    17
    18
    19
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/template_engine.rb', line 17

    def j_del
      @j_del
    end

### - (`Object`) render(context = nil, templateFileName = nil)

Raises:

- (`ArgumentError`)

    25
    26
    27
    28
    29
    30
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/template_engine.rb', line 25

    def render(context=nil,templateFileName=nil)
      if context.class.method_defined?(:j_del) && templateFileName.class == String && block_given?
        return @j_del.java_method(:render, [Java::IoVertxExtWeb::RoutingContext.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(context.j_del,templateFileName,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::Buffer) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling render(context,templateFileName)"
    end