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-2.0.0.beta10 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-2.0.0.beta9 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-2.0.0.beta8 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-2.0.0.beta7 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-2.0.0.beta6 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-2.0.0.beta4 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-2.0.0.beta3 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-1.5.5 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-2.0.0.beta2 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-2.0.0.beta1 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-1.5.4 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-1.5.3 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-1.5.2 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-1.5.1 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-1.5.0 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-1.4.2 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-1.4.1 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-1.4.0 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java
rhodes-1.2.2 platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyTwoArgMethod.java