What is the best way to define a class that can be instantiated in both Java and JRuby painlessly?

I have a class defined in JRuby. Let’s say it is called MyClass.

My goal is to have it such that in JRuby I can do…

m = MyClass.new

and in java have a function

public boolean isMyClass(Object o) {
return o instanceof MyClass

What’s the best way to do this? Write the class in Java? First priority
seamlessness, but a close second is to be fast. It’s not a super
class, so implementing it in Java is definitely feasible, I’m just not
how to make it easily instantiated in both Ruby and Java.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs