I just started with JRuby on Rails and absolutely love it. I know how to use current classes within the Java API in my Rails app, but if I wanted to create a new custom class written in purely Java code, how would I be able to use it in my Rails app?
For example, let's say I created Dog.java:
class Dog {
private String name;
public Dog() {
name = "Fido";
}
public String getName() {
return name;
}
}
How would I be able to create a new Dog object (Dog.new) in my Rails app? I need to put the Dog.java or Dog.class file somewhere, and then call some form of "import" to import it into my Rails app. I have no idea where this should go in the directory structure nor do I know where and how I should tell my app how to include it.