@JRubyMethod
public IRubyObject to_proc(ThreadContext context) {
StaticScope scope = new LocalStaticScope(null);
BlockBody body = new ContextAwareBlockBody(scope, Arity.OPTIONAL, BlockBody.SINGLE_RESTARG) {
@Override
public IRubyObject yield(ThreadContext context, IRubyObject value, Binding binding, Type type) {
RubyArray array = ArgsUtil.convertToRubyArray(context.getRuntime(), value, false);
if (array.isEmpty()) {
throw context.getRuntime().newArgumentError("no receiver given");