Issue Type: Wish Wish
Affects Versions: JRuby 1.6.7
Assignee: Unassigned
Components: Embedding, Java Integration
Created: 07/Jul/12 3:18 AM
Description:

We are doing something like this:

import org.jruby.embed.ScriptingContainer;
import java.util.Arrays;

class MethodsExample {
    pubic void myJavaMethod() {
    }

    public static void main(String[] args) {
        System.out.println("Hello world!");
        ScriptingContainer sc = new ScriptingContainer();
        MethodsExample me = new MethodsExample();

        Object rubyClass = sc.runScriptlet("Java::MethodsExample");
        sc.put("MethodExample", rubyClass);
        sc.runScriptlet("class MethodsExample ; def my_ruby_method ; puts 'YES!' ; end ; end");

        // Expect true
        sc.callMethod(me, "respond_to?" , new Object[]{"my_ruby_method"}, Boolean.class);
        // Want false
        sc.callMethod(me, "respond_to?" , new Object[]{"my_java_method"}, Boolean.class);
        // Want false
        sc.callMethod(me, "respond_to?" , new Object[]{"myJavaMethod"}, Boolean.class);
    }
}

We want to call the Ruby method only if it is defined on the Ruby side, and ignore it if it is only defined on the Java side.

Any ideas on how to do this?

Project: JRuby
Priority: Major Major
Reporter: Uwe Kubosch
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to