Hi, I’m new to JRuby and I have a question regarding passing ruby
variables to java.
In java, I have an abstract class, called JClassA and another class
In ruby, I implement the concreate class of JClassA, called RClass.
Here are the relations:
RCLass < JClassA.
JClassB(JClassA) (The constructor of JClassB takes JClassA as an
From RClass, I need to call JClassB and give the current instance as an
If I do JClassB.new(self), then it will complain about not finding the
On the other hand, if I do
JClassB.new(self.to_java(Java::SomePackage.JClassA)) then it complains
that it cannot find the method to_java in RClassB.
What am I doing wrong? Can I convert any ruby object to java object?