Class List Method List File List

# Class: VertxWeb::BridgeEvent

Inherits:
  Vertx::Future
  - Object
  - Vertx::Future
  - VertxWeb::BridgeEvent
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/bridge_event.rb

## Overview

Represents an event that occurs on the event bus bridge.

Please consult the documentation for a full explanation.

## Instance Method Summary (collapse)

- - (Hash{String => Object}) raw_message
  Get the raw JSON message for the event.
- - (::VertxWeb::SockJSSocket) socket
  Get the SockJSSocket instance corresponding to the event.
- - (:SOCKET_CREATED, ...) type
  @return the type of the event.

## Instance Method Details

### - (`Hash{String => Object}`) raw_message

Get the raw JSON message for the event. This will be null for SOCKET_CREATED or SOCKET_CLOSED events as there is no message involved.

Returns:

- (`Hash{String => Object}`) —
  the raw JSON message for the event

Raises:

- (`ArgumentError`)

    35
    36
    37
    38
    39
    40
    41
    42
    43
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/bridge_event.rb', line 35

    def raw_message
      if !block_given?
        if @cached_raw_message != nil
          return @cached_raw_message
        end
        return @cached_raw_message = @j_del.java_method(:rawMessage, []).call() != nil ? JSON.parse(@j_del.java_method(:rawMessage, []).call().encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling raw_message()"
    end

### - (`::VertxWeb::SockJSSocket`) socket

Get the SockJSSocket instance corresponding to the event

Returns:

- (`::VertxWeb::SockJSSocket`) —
  the SockJSSocket instance

Raises:

- (`ArgumentError`)

    46
    47
    48
    49
    50
    51
    52
    53
    54
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/bridge_event.rb', line 46

    def socket
      if !block_given?
        if @cached_socket != nil
          return @cached_socket
        end
        return @cached_socket = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:socket, []).call(),::VertxWeb::SockJSSocket)
      end
      raise ArgumentError, "Invalid arguments when calling socket()"
    end

### - (`:SOCKET_CREATED`, ...) type

@return the type of the event

Returns:

- (`:SOCKET_CREATED`, `:SOCKET_CLOSED`, `:SEND`, `:PUBLISH`, `:RECEIVE`, `:REGISTER`, `:UNREGISTER`)

Raises:

- (`ArgumentError`)

    23
    24
    25
    26
    27
    28
    29
    30
    31
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/bridge_event.rb', line 23

    def type
      if !block_given?
        if @cached_type != nil
          return @cached_type
        end
        return @cached_type = @j_del.java_method(:type, []).call().name.intern
      end
      raise ArgumentError, "Invalid arguments when calling type()"
    end