Sha256: 2caec602d9f9f073c2d781442d2fa61507280e2bb18bccb10ab17c8f5fd2c32a

Contents?: true

Size: 902 Bytes

Versions: 119

Compression:

Stored size: 902 Bytes

Contents

/**
 * Copyright 2005-2007 Xue Yong Zhi
 * Distributed under the BSD License
 */

package com.xruby.runtime.builtin;

import com.xruby.runtime.lang.RubyBlock;
import com.xruby.runtime.lang.RubyID;
import com.xruby.runtime.lang.RubyMethod;
import com.xruby.runtime.lang.RubyOneArgMethod;
import com.xruby.runtime.lang.RubyValue;

public class AttrWriter extends RubyOneArgMethod {
    private RubyID attrName;

    public AttrWriter(String methodName) {
        attrName = RubyID.intern("@" + methodName);
    }
    
    public AttrWriter(RubyID id) {
        attrName = RubyID.intern("@" + id.toString());
    }

    protected RubyValue run(RubyValue receiver, RubyValue arg, RubyBlock block) {
        return receiver.setInstanceVariable(arg, attrName);
    }
    
    protected void doClone(RubyMethod orig){
    	attrName = ((AttrWriter)orig).attrName;
    	
    	super.doClone(orig);
    }
    
}

Version data entries

119 entries across 119 versions & 1 rubygems

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