public RubySymbol symbolID(ByteList identifierValue) { return RubySymbol.newIDSymbol(getConfiguration().getRuntime(), identifierValue); }
public RubySymbol symbolID(ByteList identifierValue) { return RubySymbol.newIDSymbol(getConfiguration().getRuntime(), identifierValue); }
/** * When we know we need an entry in the symbol table because the provided name will be needed to be * accessed as a valid identifier later we can call this. If there is not already an entry we will * return a new symbol. Otherwise, the existing entry. * * @param name to get symbol table entry for (it may be a symbol already) * @return the symbol table entry. */ public static RubySymbol retrieveIDSymbol(IRubyObject name) { return name instanceof RubySymbol ? (RubySymbol) name : newIDSymbol(name.getRuntime(), name.convertToString().getByteList()); }
/** * When we know we need an entry in the symbol table because the provided name will be needed to be * accessed as a valid identifier later we can call this. If there is not already an entry we will * return a new symbol. Otherwise, the existing entry. * * @param name to get symbol table entry for (it may be a symbol already) * @return the symbol table entry. */ public static RubySymbol retrieveIDSymbol(IRubyObject name) { return name instanceof RubySymbol ? (RubySymbol) name : newIDSymbol(name.getRuntime(), name.convertToString().getByteList()); }
public RubySymbol asInstanceVariable() { ByteList bytes = getBytes().dup(); bytes.prepend((byte) '@'); return newIDSymbol(getRuntime(), bytes); }
/** * Make an instance variable out of this symbol (e.g. :foo will generate :foo=). * @return the new symbol */ public RubySymbol asWriter() { ByteList bytes = getBytes().dup(); bytes.append((byte) '='); return newIDSymbol(getRuntime(), bytes); }
public RubySymbol asInstanceVariable() { ByteList bytes = getBytes().dup(); bytes.prepend((byte) '@'); return newIDSymbol(getRuntime(), bytes); }
/** * Make an instance variable out of this symbol (e.g. :foo will generate :foo=). * @return the new symbol */ public RubySymbol asWriter() { ByteList bytes = getBytes().dup(); bytes.append((byte) '='); return newIDSymbol(getRuntime(), bytes); }