SetConstantChecked() публичный Метод

Sets constant of this module. Returns true if the constant is already defined in the module and it is not an autoloaded constant.
Thread safe.
public SetConstantChecked ( string name, object value ) : bool
name string
value object
Результат bool
Пример #1
0
        public static void SetConstant(RubyModule/*!*/ owner, string/*!*/ name, object value) {
            Assert.NotNull(owner, name);

            if (owner.SetConstantChecked(name, value)) {
                owner.Context.ReportWarning(String.Format("already initialized constant {0}", name));
            }

            // Initializes anonymous module's name:
            RubyModule module = value as RubyModule;
            if (module != null && module.Name == null) {
                module.Name = owner.MakeNestedModuleName(name);
            }
        }