Class: VertxShell::SockJSTermHandler

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/sock_js_term_handler.rb

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-stack/stack-docs/target/rb/vertx-shell/sock_js_term_handler.rb', line 19

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

+ (::VertxShell::SockJSTermHandler) create(vertx = nil, charset = nil)

Parameters:

  • vertx (::Vertx::Vertx) (defaults to: nil)
  • charset (String) (defaults to: nil)

Returns:

Raises:

  • (ArgumentError)


45
46
47
48
49
50
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/sock_js_term_handler.rb', line 45

def self.create(vertx=nil,charset=nil)
  if vertx.class.method_defined?(:j_del) && charset.class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShellTerm::SockJSTermHandler.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class]).call(vertx.j_del,charset),::VertxShell::SockJSTermHandler)
  end
  raise ArgumentError, "Invalid arguments when calling create(#{vertx},#{charset})"
end

+ (Object) j_api_type



28
29
30
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/sock_js_term_handler.rb', line 28

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



31
32
33
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/sock_js_term_handler.rb', line 31

def self.j_class
  Java::IoVertxExtShellTerm::SockJSTermHandler.java_class
end

+ (Object) unwrap(obj)



25
26
27
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/sock_js_term_handler.rb', line 25

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

+ (Object) wrap(obj)



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

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

Instance Method Details

- (void) handle(arg0 = nil)

This method returns an undefined value.

Parameters:

Raises:

  • (ArgumentError)


36
37
38
39
40
41
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/sock_js_term_handler.rb', line 36

def handle(arg0=nil)
  if arg0.class.method_defined?(:j_del) && !block_given?
    return @j_del.java_method(:handle, [Java::IoVertxExtWebHandlerSockjs::SockJSSocket.java_class]).call(arg0.j_del)
  end
  raise ArgumentError, "Invalid arguments when calling handle(#{arg0})"
end

- (self) term_handler { ... }

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)


53
54
55
56
57
58
59
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/sock_js_term_handler.rb', line 53

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