TryRemoveConstant() public method

public TryRemoveConstant ( string name, object &value ) : bool
name string
value object
return bool
示例#1
0
 public static object RemoveConstant(RubyModule/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ constantName) {
     object value;
     if (!self.TryRemoveConstant(constantName, out value)) {
         self.Context.CheckConstantName(constantName);
         throw RubyExceptions.CreateNameError(String.Format("constant {0}::{1} not defined", self.Name, constantName));
     }
     return value;
 }
示例#2
0
        public static object RemoveConstant(RubyModule /*!*/ self, [DefaultProtocol, NotNull] string /*!*/ constantName)
        {
            object value;

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