Exemplo n.º 1
0
  public static Block createMethodBlock(
      ThreadContext context, IRubyObject self, DynamicScope dynamicScope, MethodBlock body) {
    RubyMethod method = body.method;
    RubyModule module = method.getMethod().getImplementationClass();
    Frame frame = new Frame();

    frame.setKlazz(module);
    frame.setName(method.getMethodName());
    frame.setSelf(method.receiver(context));
    frame.setVisibility(method.getMethod().getVisibility());

    Binding binding =
        new Binding(
            frame,
            dynamicScope,
            new BacktraceElement(method.getMethodName(), body.getFile(), body.getLine()));

    return new Block(body, binding);
  }