Class List Method List File List

# Class: VertxWeb::SockJSHandler

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

## Class Method Summary (collapse)

- + (Object) create(vertx = nil, options = nil)
- + (Object) install_test_applications(router = nil, vertx = nil)

## Instance Method Summary (collapse)

- - (Object) bridge(bridgeOptions = nil)
- - (Object) handle(arg0 = nil)
- - (SockJSHandler) initialize(j_del) constructor
  A new instance of SockJSHandler.
- - (Object) j_del
- - (Object) socket_handler

## Constructor Details

### - (`SockJSHandler`) initialize(j_del)

Returns a new instance of SockJSHandler

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

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) create(vertx = nil, options = nil)

Raises:

- (`ArgumentError`)

    37
    38
    39
    40
    41
    42
    43
    44
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/sock_js_handler.rb', line 37

    def self.create(vertx=nil,options=nil)
      if vertx.class.method_defined?(:j_del) && !block_given? && options == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandlerSockjs::SockJSHandler.java_method(:create, [Java::IoVertxCore::Vertx.java_class]).call(vertx.j_del),::VertxWeb::SockJSHandler)
      elsif vertx.class.method_defined?(:j_del) && options.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandlerSockjs::SockJSHandler.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtWebHandlerSockjs::SockJSHandlerOptions.java_class]).call(vertx.j_del,Java::IoVertxExtWebHandlerSockjs::SockJSHandlerOptions.new(::Vertx::Util::Utils.to_json_object(options))),::VertxWeb::SockJSHandler)
      end
      raise ArgumentError, "Invalid arguments when calling create(vertx,options)"
    end

### + (`Object`) install_test_applications(router = nil, vertx = nil)

Raises:

- (`ArgumentError`)

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

    def self.install_test_applications(router=nil,vertx=nil)
      if router.class.method_defined?(:j_del) && vertx.class.method_defined?(:j_del) && !block_given?
        return Java::IoVertxExtWebHandlerSockjs::SockJSHandler.java_method(:installTestApplications, [Java::IoVertxExtWeb::Router.java_class,Java::IoVertxCore::Vertx.java_class]).call(router.j_del,vertx.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling install_test_applications(router,vertx)"
    end

## Instance Method Details

### - (`Object`) bridge(bridgeOptions = nil)

Raises:

- (`ArgumentError`)

    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/sock_js_handler.rb', line 71

    def bridge(bridgeOptions=nil)
      if bridgeOptions.class == Hash && !block_given?
        @j_del.java_method(:bridge, [Java::IoVertxExtWebHandlerSockjs::BridgeOptions.java_class]).call(Java::IoVertxExtWebHandlerSockjs::BridgeOptions.new(::Vertx::Util::Utils.to_json_object(bridgeOptions)))
        return self
      elsif bridgeOptions.class == Hash && block_given?
        @j_del.java_method(:bridge, [Java::IoVertxExtWebHandlerSockjs::BridgeOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxExtWebHandlerSockjs::BridgeOptions.new(::Vertx::Util::Utils.to_json_object(bridgeOptions)),(Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxWeb::BridgeEvent)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling bridge(bridgeOptions)"
    end

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

Raises:

- (`ArgumentError`)

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

    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

### - (`Object`) j_del

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

    def j_del
      @j_del
    end

### - (`Object`) socket_handler

Raises:

- (`ArgumentError`)

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

    def socket_handler
      if block_given?
        @j_del.java_method(:socketHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxWeb::SockJSSocket)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling socket_handler()"
    end