Class List Method List File List

# Class: VertxStomp::ServerFrame

Inherits:
  Object
  - Object
  - VertxStomp::ServerFrame
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/server_frame.rb

## Overview

Structure passed to server handler when receiving a frame. It provides a reference on the received Hash but also on the StompServerConnection.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (::VertxStomp::StompServerConnection) connection
  The connection.
- - (Hash) frame
  The received frame.

## Class Method Details

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

Returns:

- (`Boolean`)

    19
    20
    21
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/server_frame.rb', line 19

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

### + (`Object`) j_api_type

    28
    29
    30
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/server_frame.rb', line 28

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    31
    32
    33
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/server_frame.rb', line 31

    def self.j_class
      Java::IoVertxExtStomp::ServerFrame.java_class
    end

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

    25
    26
    27
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/server_frame.rb', line 25

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

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

    22
    23
    24
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/server_frame.rb', line 22

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

## Instance Method Details

### - (`::VertxStomp::StompServerConnection`) connection

Returns the connection

Returns:

- (`::VertxStomp::StompServerConnection`) —
  the connection

Raises:

- (`ArgumentError`)

    42
    43
    44
    45
    46
    47
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/server_frame.rb', line 42

    def connection
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:connection, []).call(),::VertxStomp::StompServerConnection)
      end
      raise ArgumentError, "Invalid arguments when calling connection()"
    end

### - (`Hash`) frame

Returns the received frame

Returns:

- (`Hash`) —
  the received frame

Raises:

- (`ArgumentError`)

    35
    36
    37
    38
    39
    40
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/server_frame.rb', line 35

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