如何在java对象上调用“send”而不是Ruby的内置“发送”?

时间:2021-10-08 23:32:31

Ruby objects all have a "send" method, however, I'm trying to use a Java library (netty-tools) which has a 'send' method on one of its interfaces.

Ruby对象都有一个“发送”方法,但是,我正在尝试使用一个Java库(netty-tools),它在其中一个接口上有一个'send'方法。

The usage should be java_obj.send 'some data' but that doesn't work b/c ruby's send is getting invoked, not the send from the Java interface in netty-tools. Is there some way of calling the send method from the Java library?

用法应该是java_obj.send'some data'但是这不起作用b / c ruby​​的send被调用,而不是netty-tools中的Java接口发送。有没有办法从Java库调用send方法?

1 个解决方案

#1


3  

You should be able to use java_send, roughly:

您应该能够大致使用java_send:

java_obj.java_send :send 'some data'

Here are some additional usage details (e.g., overloaded methods).

以下是一些其他使用细节(例如,重载方法)。

#1


3  

You should be able to use java_send, roughly:

您应该能够大致使用java_send:

java_obj.java_send :send 'some data'

Here are some additional usage details (e.g., overloaded methods).

以下是一些其他使用细节(例如,重载方法)。