Sha256: 5be7dfb43abb4886dedff54ec80941a4c4785759515792cbe2ff84ff7b0d5af4
Contents?: true
Size: 929 Bytes
Versions: 119
Compression:
Stored size: 929 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
119 entries across 119 versions & 1 rubygems