Class: VertxWebGraphql::ApolloWSMessage

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/apollo_ws_message.rb

Overview

A message recevied over Apollo's subscriptions-transport-ws transport.

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-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/apollo_ws_message.rb', line 18

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

+ (Object) j_api_type


27
28
29
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/apollo_ws_message.rb', line 27

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class


30
31
32
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/apollo_ws_message.rb', line 30

def self.j_class
  Java::IoVertxExtWebHandlerGraphql::ApolloWSMessage.java_class
end

+ (Object) unwrap(obj)


24
25
26
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/apollo_ws_message.rb', line 24

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

+ (Object) wrap(obj)


21
22
23
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/apollo_ws_message.rb', line 21

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

Instance Method Details

- (Hash{String => Object}) content

Returns the message content

Returns:

  • (Hash{String => Object})
    the message content

Raises:

  • (ArgumentError)

48
49
50
51
52
53
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/apollo_ws_message.rb', line 48

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

- (::Vertx::ServerWebSocket) server_web_socket

Returns the websocket that received the message

Returns:

Raises:

  • (ArgumentError)

34
35
36
37
38
39
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/apollo_ws_message.rb', line 34

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

- (:CONNECTION_INIT, ...) type

Returns the message type

Returns:

  • (:CONNECTION_INIT, :CONNECTION_TERMINATE, :START, :STOP, :CONNECTION_ACK, :CONNECTION_ERROR, :CONNECTION_KEEP_ALIVE, :DATA, :ERROR, :COMPLETE)
    the message type

Raises:

  • (ArgumentError)

41
42
43
44
45
46
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/apollo_ws_message.rb', line 41

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