Class List Method List File List

# Class: VertxWeb::LoggerHandler

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

## Overview

A handler which logs request information to the Vert.x logger.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxWeb::LoggerHandler) create(param_1 = nil, param_2 = nil)
  Create a handler with he specified format.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) handle(arg0 = nil)

## Class Method Details

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

Returns:

- (`Boolean`)

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

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

### + (`::VertxWeb::LoggerHandler`) create + (`::VertxWeb::LoggerHandler`) create(format) + (`::VertxWeb::LoggerHandler`) create(immediate, format)

Create a handler with he specified format

Overloads:

- + (`::VertxWeb::LoggerHandler`) create(format)

  Parameters:

  - format (`:DEFAULT`, `:SHORT`, `:TINY`) —
    the format
- + (`::VertxWeb::LoggerHandler`) create(immediate, format)

  Parameters:

  - immediate (`true`, `false`) —
    true if logging should occur as soon as request arrives
  - format (`:DEFAULT`, `:SHORT`, `:TINY`) —
    the format

Returns:

- (`::VertxWeb::LoggerHandler`) —
  the handler

Raises:

- (`ArgumentError`)

    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/logger_handler.rb', line 49

    def self.create(param_1=nil,param_2=nil)
      if !block_given? && param_1 == nil && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::LoggerHandler.java_method(:create, []).call(),::VertxWeb::LoggerHandler)
      elsif param_1.class == Symbol && !block_given? && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::LoggerHandler.java_method(:create, [Java::IoVertxExtWebHandler::LoggerFormat.java_class]).call(Java::IoVertxExtWebHandler::LoggerFormat.valueOf(param_1.to_s)),::VertxWeb::LoggerHandler)
      elsif (param_1.class == TrueClass || param_1.class == FalseClass) && param_2.class == Symbol && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::LoggerHandler.java_method(:create, [Java::boolean.java_class,Java::IoVertxExtWebHandler::LoggerFormat.java_class]).call(param_1,Java::IoVertxExtWebHandler::LoggerFormat.valueOf(param_2.to_s)),::VertxWeb::LoggerHandler)
      end
      raise ArgumentError, "Invalid arguments when calling create(#{param_1},#{param_2})"
    end

### + (`Object`) j_api_type

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

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

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

    def self.j_class
      Java::IoVertxExtWebHandler::LoggerHandler.java_class
    end

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

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

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

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

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

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

## Instance Method Details

### - (`void`) handle(arg0 = nil)

This method returns an undefined value.

Parameters:

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

Raises:

- (`ArgumentError`)

    35
    36
    37
    38
    39
    40
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/logger_handler.rb', line 35

    def handle(arg0=nil)
      if arg0.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:handle, [Java::IoVertxExtWeb::RoutingContext.java_class]).call(arg0.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling handle(#{arg0})"
    end