@Override void install(final RubyModule proxy) { if ( localConstructor ) { proxy.addMethod(name, new ConstructorInvoker(proxy, constructors, name)); } else { // if there's no constructor, we must prevent construction proxy.addMethod(name, new org.jruby.internal.runtime.methods.JavaMethod(proxy, PUBLIC, name) { @Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) { throw context.runtime.newTypeError("no public constructors for " + clazz); } }); } } }
@Override void install(final RubyModule proxy) { if ( localConstructor ) { proxy.addMethod(name, new ConstructorInvoker(proxy, constructors, name)); } else { // if there's no constructor, we must prevent construction proxy.addMethod(name, new org.jruby.internal.runtime.methods.JavaMethod(proxy, PUBLIC, name) { @Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) { throw context.runtime.newTypeError("no public constructors for " + clazz); } }); } } }
void install(final RubyModule proxy) { if (haveLocalConstructor) { DynamicMethod method = new ConstructorInvoker(proxy, constructors); proxy.addMethod(name, method); } else { // if there's no constructor, we must prevent construction proxy.addMethod(name, new org.jruby.internal.runtime.methods.JavaMethod(proxy, PUBLIC) { @Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) { throw context.runtime.newTypeError("no public constructors for " + clazz); } }); } } }
void install(final RubyModule proxy) { if (haveLocalConstructor) { DynamicMethod method = new ConstructorInvoker(proxy, constructors); proxy.addMethod(name, method); } else { // if there's no constructor, we must prevent construction proxy.addMethod(name, new org.jruby.internal.runtime.methods.JavaMethod(proxy, PUBLIC) { @Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) { throw context.runtime.newTypeError("no public constructors for " + clazz); } }); } } }