private static void handleContextsAnnotation(Class<? extends Processor> processor, RubyClass rubyClass) { Ruby rubyRuntime = rubyClass.getRuntime(); if (processor.isAnnotationPresent(Contexts.class)) { Contexts contexts = processor.getAnnotation(Contexts.class); RubyArray contextList = rubyRuntime.newArray(); for (String value : contexts.value()) { contextList.add(rubyRuntime.newSymbol(value.substring(1))); } rubyClass.callMethod(rubyRuntime.getCurrentContext(), "option", new IRubyObject[]{ rubyRuntime.newSymbol("contexts"), contextList }); } }
private static void handleContextsAnnotation(Class<? extends Processor> processor, RubyClass rubyClass) { Ruby rubyRuntime = rubyClass.getRuntime(); if (processor.isAnnotationPresent(Contexts.class)) { Contexts contexts = processor.getAnnotation(Contexts.class); RubyArray contextList = rubyRuntime.newArray(); for (String value : contexts.value()) { contextList.add(rubyRuntime.newSymbol(value.substring(1))); } rubyClass.callMethod(rubyRuntime.getCurrentContext(), "option", new IRubyObject[]{ rubyRuntime.newSymbol("contexts"), contextList }); } }