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)


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

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

+ (Object) j_api_type



28
29
30
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/apollo_ws_message.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-web-graphql/apollo_ws_message.rb', line 31

def self.j_class
  Java::IoVertxExtWebHandlerGraphql::ApolloWSMessage.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-web-graphql/apollo_ws_message.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-web-graphql/apollo_ws_message.rb', line 22

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


60
61
62
63
64
65
66
67
68
69
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/apollo_ws_message.rb', line 60

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

- (::Vertx::ServerWebSocket) serverWebSocket

Returns the websocket that received the message

Returns:



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

def server_web_socket
  if !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:serverWebSocket, []).call(),::Vertx::ServerWebSocket)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling server_web_socket()"
  end
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


48
49
50
51
52
53
54
55
56
57
# 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 type
  if !block_given?
    return @j_del.java_method(:type, []).call().name.intern
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling type()"
  end
end