Forum: JRuby Referring to a Java Class type from Ruby

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ccb9dcb7ff797b6875d8c98b61978474?d=identicon&s=25 Michael C. (kabbotta)
on 2013-12-12 04:05
I'm working on a game in libgdx, a Java library, and one of the methods
requires a reference to the type of Java class being passed.

In Java, the method is:

public <T> T get (String name, Class<T> type) {



And the call was:

craftWindow.setStyle(skin.get("craftWindow", WindowStyle.class));

How can I do this call in JRuby? When I pass the same string and then
WindowStyle.class it says:

no get with arguments matching [class org.jruby.
RubyString, class org.jruby.RubyClass] on object

I've imported it with:

java_import com.badlogic.gdx.scenes.scene2d.ui.Window::WindowStyle

I'm not sure about that line either. Thanks for any help.
773c21073bd45af7c4f90ce516827752?d=identicon&s=25 Eric W. (edubkendo)
on 2013-12-12 10:07
(Received via mailing list)


Im not sure what the library is looking for here, but this may do the
Ccb9dcb7ff797b6875d8c98b61978474?d=identicon&s=25 Michael C. (kabbotta)
on 2013-12-12 19:00
Thanks, that seems to do the trick. I didn't even need it on the string,
just the WindowStyle class. Thanks again.
This topic is locked and can not be replied to.