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

Version Path
rhodes-3.3.0.beta.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.3.0.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.3 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.2.beta platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.0 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.0.beta.9 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.0.beta.8 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.0.beta.7 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.0.beta.6 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.0.beta.5 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.0.beta.4 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.0.beta.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.2.0.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.1.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.1.1.beta platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.1.0 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.1.0.beta.5 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java
rhodes-3.1.0.beta.4 platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyOneArgMethod.java