Class List Method List File List

# Class: VertxWeb::PebbleTemplateEngine

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

## Overview

A template engine that uses the Pebble library.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxWeb::PebbleTemplateEngine) create(vertx = nil)
  Create a template engine using defaults.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) render(arg0 = nil, arg1 = nil) { ... }
- - (::VertxWeb::PebbleTemplateEngine) set_extension(extension = nil)
  Set the extension for the engine.
- - (::VertxWeb::PebbleTemplateEngine) set_max_cache_size(maxCacheSize = nil)
  Set the max cache size for the engine.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

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

    def @@j_api_type.accept?(obj)
      obj.class == PebbleTemplateEngine
    end

### + (`::VertxWeb::PebbleTemplateEngine`) create(vertx = nil)

Create a template engine using defaults

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`)

Returns:

- (`::VertxWeb::PebbleTemplateEngine`) —
  the engine

Raises:

- (`ArgumentError`)

    50
    51
    52
    53
    54
    55
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/pebble_template_engine.rb', line 50

    def self.create(vertx=nil)
      if vertx.class.method_defined?(:j_del) && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebTempl::PebbleTemplateEngine.java_method(:create, [Java::IoVertxCore::Vertx.java_class]).call(vertx.j_del),::VertxWeb::PebbleTemplateEngine)
      end
      raise ArgumentError, "Invalid arguments when calling create(#{vertx})"
    end

### + (`Object`) j_api_type

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

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    34
    35
    36
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/pebble_template_engine.rb', line 34

    def self.j_class
      Java::IoVertxExtWebTempl::PebbleTemplateEngine.java_class
    end

### + (`Object`) unwrap(obj)

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

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

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

    def @@j_api_type.wrap(obj)
      PebbleTemplateEngine.new(obj)
    end

## Instance Method Details

### - (`void`) render(arg0 = nil, arg1 = nil) { ... }

This method returns an undefined value.

Parameters:

- arg0 (`::VertxWeb::RoutingContext`) (defaults to: `nil`)
- arg1 (`String`) (defaults to: `nil`)

Yields:

Raises:

- (`ArgumentError`)

    41
    42
    43
    44
    45
    46
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/pebble_template_engine.rb', line 41

    def render(arg0=nil,arg1=nil)
      if arg0.class.method_defined?(:j_del) && arg1.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(arg0.j_del,arg1,(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(#{arg0},#{arg1})"
    end

### - (`::VertxWeb::PebbleTemplateEngine`) set_extension(extension = nil)

Set the extension for the engine

Parameters:

- extension (`String`) (defaults to: `nil`) —
  the extension

Returns:

- (`::VertxWeb::PebbleTemplateEngine`) —
  a reference to this for fluency

Raises:

- (`ArgumentError`)

    59
    60
    61
    62
    63
    64
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/pebble_template_engine.rb', line 59

    def set_extension(extension=nil)
      if extension.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setExtension, [Java::java.lang.String.java_class]).call(extension),::VertxWeb::PebbleTemplateEngine)
      end
      raise ArgumentError, "Invalid arguments when calling set_extension(#{extension})"
    end

### - (`::VertxWeb::PebbleTemplateEngine`) set_max_cache_size(maxCacheSize = nil)

Set the max cache size for the engine

Parameters:

- maxCacheSize (`Fixnum`) (defaults to: `nil`) —
  the maxCacheSize

Returns:

- (`::VertxWeb::PebbleTemplateEngine`) —
  a reference to this for fluency

Raises:

- (`ArgumentError`)

    68
    69
    70
    71
    72
    73
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/pebble_template_engine.rb', line 68

    def set_max_cache_size(maxCacheSize=nil)
      if maxCacheSize.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setMaxCacheSize, [Java::int.java_class]).call(maxCacheSize),::VertxWeb::PebbleTemplateEngine)
      end
      raise ArgumentError, "Invalid arguments when calling set_max_cache_size(#{maxCacheSize})"
    end