On Wed, May 21, 2008 at 7:55 AM, Sergio Oliveira
[email protected] wrote:
I may be missing something or that may not be possible/desired.
I do something like this:
Object rubyObject = ruby.eval(“MyObject.new”);
I am not saying this is the best way but it should give you ideas:
Object rubyObject = ruby.eval("$object = MyObject.new");
// do stuff …
Any way to take a RubyObject in Java to the Ruby side so I can use it for
example inside an eval call?
I could not find this method java_object. From what class it belongs? Is
there a JRuby JavaDoc API somewhere?
It is only on ruby side of things…not a Java method. You probably
don’t need it in this case.
Since my objects will be short lived web actions, I am considering keeping
them in a global map in the Ruby side, so that I also have the object saved
and easily accessible in the Ruby side. When my java object is finalized by
GC I will remove the object from this map in the ruby map.
That works. I think you will need to be careful about makign sure you
do not retain references since you will have one reference from Ruby
and one from Java side.
Email: [email protected] , [email protected]
To unsubscribe from this list, please visit: