Пример #1
0
 public static object RemoveConstant(RubyModule/*!*/ self, [DefaultProtocol]string/*!*/ constantName) {
     object value;
     if (!self.TryGetConstantNoAutoload(constantName, out value)) {
         RubyUtils.CheckConstantName(constantName);
         throw RubyExceptions.CreateNameError(String.Format("constant {0}::{1} not defined", self.Name, constantName));
     }
     self.RemoveConstant(constantName);
     return value;
 }
Пример #2
0
        public static object RemoveConstant(RubyModule /*!*/ self, [DefaultProtocol] string /*!*/ constantName)
        {
            object value;

            if (!self.TryGetConstantNoAutoload(constantName, out value))
            {
                RubyUtils.CheckConstantName(constantName);
                throw RubyExceptions.CreateNameError(String.Format("constant {0}::{1} not defined", self.Name, constantName));
            }
            self.RemoveConstant(constantName);
            return(value);
        }