Sha256: 07fe4567fdbf28913d00d040c3304cf09f1254c412359e1e688051fa472b14f0

Contents?: true

Size: 898 Bytes

Versions: 8

Compression:

Stored size: 898 Bytes

Contents

package sandbox;

import org.jruby.anno.JRubyClass;
import org.jruby.anno.JRubyMethod;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.runtime.Block;

@JRubyClass(name="BoxedClass")
public class BoxedClass {
  @JRubyMethod(module=true, rest=true)
  public static IRubyObject method_missing(IRubyObject recv, IRubyObject[] args, Block block) {
    IRubyObject[] args2 = new IRubyObject[args.length - 1];
    System.arraycopy(args, 1, args2, 0, args2.length);
    String name = args[0].toString();

    SandboxFull box = (SandboxFull) SandboxFull.getLinkedBox(recv);
    return box.runMethod(recv, name, args2, block);
  }

  @JRubyMethod(name="new", meta=true, rest=true)
  public static IRubyObject _new(IRubyObject recv, IRubyObject[] args, Block block) {
    SandboxFull box = (SandboxFull) SandboxFull.getLinkedBox(recv);
    return box.runMethod(recv, "new", args, block);
  }
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jruby_sandbox-0.2.2-java ext/java/sandbox/BoxedClass.java
jruby_sandbox-0.2.1-java ext/java/sandbox/BoxedClass.java
jruby_sandbox-0.2.0-java ext/java/sandbox/BoxedClass.java
jruby_sandbox-0.1.4-java ext/java/sandbox/BoxedClass.java
jruby_sandbox-0.1.3-java ext/java/sandbox/BoxedClass.java
jruby_sandbox-0.1.2-java ext/java/sandbox/BoxedClass.java
jruby_sandbox-0.1.1-java ext/java/sandbox/BoxedClass.java
jruby_sandbox-0.1.0-java ext/java/sandbox/BoxedClass.java