@Deprecated public IRubyObject fastStoreConstant(String internedName, IRubyObject value) { return storeConstant(internedName, value); }
@Deprecated public IRubyObject fastStoreConstant(String internedName, IRubyObject value) { return storeConstant(internedName, value); }
@Deprecated public IRubyObject fastStoreConstant(String internedName, IRubyObject value) { return storeConstant(internedName, value); }
@Deprecated public IRubyObject fastStoreConstant(String internedName, IRubyObject value) { return storeConstant(internedName, value); }
public final void setConstantVisibility(Ruby runtime, String name, boolean hidden) { ConstantEntry entry = getConstantMap().get(name); if (entry == null) { throw runtime.newNameError("constant " + getName() + "::" + name + " not defined", name); } storeConstant(name, entry.value, hidden); }
/** * Set an Object as a defined constant in autoloading. */ private void setAutoloadConstant(String name, IRubyObject value) { Autoload autoload = getAutoloadMap().get(name); if (autoload != null) { if (!autoload.setConstant(getRuntime().getCurrentContext(), value)) { storeConstant(name, value); removeAutoload(name); } } else { storeConstant(name, value); } }
public final void setConstantVisibility(Ruby runtime, String name, boolean hidden) { ConstantEntry entry = getConstantMap().get(name); if (entry == null) { throw runtime.newNameError("constant " + getName() + "::" + name + " not defined", name); } storeConstant(name, entry.value, hidden); }
/** * Set an Object as a defined constant in autoloading. */ private void setAutoloadConstant(String name, IRubyObject value) { Autoload autoload = getAutoloadMap().get(name); if (autoload != null) { if (!autoload.setConstant(getRuntime().getCurrentContext(), value)) { storeConstant(name, value); removeAutoload(name); } } else { storeConstant(name, value); } }
/** * Define an autoload. ConstantMap holds UNDEF for the name as an autoload marker. */ protected final void defineAutoload(String name, AutoloadMethod loadMethod) { final Autoload existingAutoload = getAutoloadMap().get(name); if (existingAutoload == null || existingAutoload.getValue() == null) { storeConstant(name, RubyObject.UNDEF); getAutoloadMapForWrite().put(name, new Autoload(loadMethod)); } }
/** * Define an autoload. ConstantMap holds UNDEF for the name as an autoload marker. */ protected void defineAutoload(String name, IAutoloadMethod loadMethod) { Autoload existingAutoload = getAutoloadMap().get(name); if (existingAutoload == null || existingAutoload.getValue() == null) { storeConstant(name, RubyObject.UNDEF); getAutoloadMapForWrite().put(name, new Autoload(loadMethod)); } }
/** * Extract an Object which is defined by autoload thread from autoloadMap and define it as a constant. */ protected IRubyObject finishAutoload(String name) { Autoload autoload = getAutoloadMap().get(name); if (autoload != null) { IRubyObject value = autoload.getValue(); if (value != null) { storeConstant(name, value); } removeAutoload(name); return value; } return null; }
/** * Define an autoload. ConstantMap holds UNDEF for the name as an autoload marker. */ protected void defineAutoload(String name, IAutoloadMethod loadMethod) { Autoload existingAutoload = getAutoloadMap().get(name); if (existingAutoload == null || existingAutoload.getValue() == null) { storeConstant(name, RubyObject.UNDEF); getAutoloadMapForWrite().put(name, new Autoload(loadMethod)); } }
/** * Define an autoload. ConstantMap holds UNDEF for the name as an autoload marker. */ protected final void defineAutoload(String name, AutoloadMethod loadMethod) { final Autoload existingAutoload = getAutoloadMap().get(name); if (existingAutoload == null || existingAutoload.getValue() == null) { storeConstant(name, RubyObject.UNDEF); getAutoloadMapForWrite().put(name, new Autoload(loadMethod)); } }
/** * Extract an Object which is defined by autoload thread from autoloadMap and define it as a constant. */ protected IRubyObject finishAutoload(String name) { Autoload autoload = getAutoloadMap().get(name); if (autoload != null) { IRubyObject value = autoload.getValue(); if (value != null) { storeConstant(name, value); } removeAutoload(name); return value; } return null; }
/** * Extract an Object which is defined by autoload thread from autoloadMap and define it as a constant. */ protected final IRubyObject finishAutoload(String name) { final Autoload autoload = getAutoloadMap().get(name); if ( autoload == null ) return null; final IRubyObject value = autoload.getValue(); if ( value != null ) { storeConstant(name, value); } removeAutoload(name); invalidateConstantCache(name); return value; }
/** * Extract an Object which is defined by autoload thread from autoloadMap and define it as a constant. */ protected final IRubyObject finishAutoload(String name) { final Autoload autoload = getAutoloadMap().get(name); if ( autoload == null ) return null; final IRubyObject value = autoload.getValue(); if ( value != null ) { storeConstant(name, value); } removeAutoload(name); invalidateConstantCache(name); return value; }
public void deprecateConstant(Ruby runtime, String name) { ConstantEntry entry = getConstantMap().get(name); if (entry == null) { throw runtime.newNameError(str(runtime, "constant ", types(runtime, this), "::", ids(runtime, name), " not defined"), name); } storeConstant(name, entry.value, entry.hidden, true); invalidateConstantCache(name); }
public void deprecateConstant(Ruby runtime, String name) { ConstantEntry entry = getConstantMap().get(name); if (entry == null) { throw runtime.newNameError(str(runtime, "constant ", types(runtime, this), "::", ids(runtime, name), " not defined"), name); } storeConstant(name, entry.value, entry.hidden, true); invalidateConstantCache(name); }
/** * Injects ARGV values to a parsed Ruby script. This method is * invoked during EvalUnit#run() is executed. * * @param runtime is environment where a variable injection occurs * @param receiver is the instance that will have variable injection. */ public void inject() { updateArgvByJavaObject(); RubyModule rubyModule = getRubyClass(receiver.getRuntime()); if (rubyModule == null) rubyModule = receiver.getRuntime().getCurrentContext().getRubyClass(); if (rubyModule == null) return; rubyModule.storeConstant(name, irubyObject); receiver.getRuntime().getConstantInvalidator(name).invalidate(); fromRuby = true; }
/** * Injects a constant value to a parsed Ruby script. This method is * invoked during EvalUnit#run() is executed. */ public void inject() { if (receiver == receiver.getRuntime().getTopSelf()) { RubyModule rubyModule = getRubyClass(receiver.getRuntime()); if (rubyModule == null) rubyModule = receiver.getRuntime().getCurrentContext().getRubyClass(); if (rubyModule == null) return; rubyModule.storeConstant(name, irubyObject); } else { receiver.getMetaClass().storeConstant(name, irubyObject); } receiver.getRuntime().getConstantInvalidator(name).invalidate(); initialized = true; }