Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 25th, 2012  |  syntax: None  |  size: 0.47 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public class John implements BasicLibraryService {
  2.  
  3.     public boolean basicLoad(Ruby ruby) throws IOException {
  4.         RubyModule module = ruby.getModule("MyRubyModule");
  5.         module.defineAnnotatedMethods(JohnExtension.class);
  6.  
  7.         return true;
  8.     }
  9.  
  10. }
  11.  
  12. /////////////////////////////
  13.  
  14. public class JohnExtension {
  15.  
  16.     @JRubyMethod(name="my_method")
  17.     public static String myMethod(String html, String namespace) {
  18.         return "hello world";
  19.     }
  20.  
  21. }