Sha256: 55446408dc51de8375e9d7e48c77b52c7b4fb5e201b18ab90b43d8719baeaaed
Contents?: true
Size: 1.02 KB
Versions: 18
Compression:
Stored size: 1.02 KB
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.RubyNoArgMethod; import com.xruby.runtime.lang.RubyValue; import com.xruby.runtime.lang.RubyMethod; public class AttrReader extends RubyNoArgMethod { private RubyID attrName; public AttrReader(String methodName) { attrName = RubyID.intern("@" + methodName); } public AttrReader(RubyID id) { attrName = RubyID.intern("@" + id.toString()); } protected RubyValue run(RubyValue receiver, RubyBlock block) { return receiver.getInstanceVariable(attrName); } public RubyMethod clone(){ AttrReader cl = new AttrReader(""); cl.doClone((RubyMethod)this); return cl; } protected void doClone(RubyMethod orig){ attrName = ((AttrReader)orig).attrName; super.doClone(orig); } }
Version data entries
18 entries across 18 versions & 2 rubygems