Class: VertxWeb::VirtualHostHandler

Inherits:
Object
  • Object
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.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


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

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

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

Create a handler

Parameters:

  • hostname (String) (defaults to: nil)

Yields:

Returns:

Raises:

  • (ArgumentError)


45
46
47
48
49
50
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/virtual_host_handler.rb', line 45

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

+ (Object) j_api_type



27
28
29
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/virtual_host_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/virtual_host_handler.rb', line 30

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

+ (Object) unwrap(obj)



24
25
26
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/virtual_host_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/virtual_host_handler.rb', line 21

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

Instance Method Details

- (void) handle(arg0 = nil)

This method returns an undefined value.

Parameters:

Raises:

  • (ArgumentError)


35
36
37
38
39
40
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/virtual_host_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