Sha256: 63d9c1576cc527b1652e2b8d6e15293fa5e6976f4a7eac8ba4a0fffe7c10cb00

Contents?: true

Size: 935 Bytes

Versions: 119

Compression:

Stored size: 935 Bytes

Contents

/** 
 * Copyright 2007 Xue Yong Zhi, Ye Zheng
 * Distributed under the BSD License
 */

package com.xruby.runtime.lang;

import com.xruby.runtime.builtin.RubyArray;

public abstract class RubyTwoArgMethod extends RubyMethod {
	public RubyTwoArgMethod() {
		super(2, false, 0);
	}
	
	protected abstract RubyValue run(RubyValue receiver, RubyValue arg1, RubyValue arg2, RubyBlock block);
	
	public RubyValue invoke(RubyValue receiver, RubyBlock block) {
		throw new RubyException(RubyRuntime.ArgumentErrorClass, "in `" + this.getID() + "': wrong number of arguments (0 for 2)");
	}

	public RubyValue invoke(RubyValue receiver, RubyValue arg, RubyBlock block) {
		throw new RubyException(RubyRuntime.ArgumentErrorClass, "in `" + this.getID() + "': wrong number of arguments (1 for 2)");
	}

	protected RubyValue run(RubyValue receiver, RubyArray args, RubyBlock block) {
		return this.run(receiver, args.get(0), args.get(1), block);
	}
}

Version data entries

119 entries across 119 versions & 1 rubygems

Version Path
rhodes-3.5.1.12 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.5 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.4.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.4 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.3 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.3.beta.4 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.3.beta.3 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.3.beta.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.3.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.2.beta.7 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.2.beta.6 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.2.beta.5 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.2.beta.4 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.2.beta.3 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.2.beta.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.2.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.0 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-3.3.0.beta.3 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java