Sha256: 274b04234203d31717e76ea077d01a2000d66c8a33d4e93bf472026376d620ec
Contents?: true
Size: 957 Bytes
Versions: 135
Compression:
Stored size: 957 Bytes
Contents
/** * Copyright 2007 Ye Zheng * Distributed under the BSD License */ package com.xruby.runtime.lang; import com.xruby.runtime.builtin.RubyArray; public abstract class RubyOneArgMethod extends RubyMethod { public RubyOneArgMethod() { super(1, false, 0); } protected abstract RubyValue run(RubyValue receiver, RubyValue arg, RubyBlock block); public RubyValue invoke(RubyValue receiver, RubyBlock block) { throw new RubyException(RubyRuntime.ArgumentErrorClass, "in `" + this.getID() + "': wrong number of arguments (0 for 1)"); } public RubyValue invoke(RubyValue receiver, RubyValue arg0, RubyValue arg1, RubyBlock block) { throw new RubyException(RubyRuntime.ArgumentErrorClass, "in `" + this.getID() + "': wrong number of arguments (2 for 1)"); } protected RubyValue run(RubyValue receiver, RubyArray args, RubyBlock block) { return this.run(receiver, args.get(0), block); } }
Version data entries
135 entries across 135 versions & 2 rubygems