Class List Method List File List

# Class: VertxWeb::VirtualHostHandler

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

## Overview

Handler that will filter requests based on the request Host name.

## Class Method Summary (collapse)

- + (::VertxWeb::VirtualHostHandler) create(hostname = nil) { ... }
  Create a handler.

## Instance Method Summary (collapse)

- - (void) handle(arg0 = nil)

## Class Method Details

### + (`::VertxWeb::VirtualHostHandler`) create(hostname = nil) { ... }

Create a handler

Parameters:

- hostname (`String`) (defaults to: `nil`)

Yields:

Returns:

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

Raises:

- (`ArgumentError`)

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

    def self.create(hostname=nil)
      if hostname.class == String && block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::VirtualHostHandler.java_method(:create, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(hostname,(Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxWeb::RoutingContext)) })),::VertxWeb::VirtualHostHandler)
      end
      raise ArgumentError, "Invalid arguments when calling create(hostname)"
    end

## Instance Method Details

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

This method returns an undefined value.

Parameters:

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

Raises:

- (`ArgumentError`)

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

    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