public static object GetTaggedClasses(RubyModule/*!*/ self) { object taggedClasses; if (!self.TryGetClassVariable(_TaggedClasses, out taggedClasses)) { taggedClasses = CreateDefaultTagMapping(self.Context); self.SetClassVariable(_TaggedClasses, taggedClasses); } return taggedClasses; }
public static Int32? GetBufferSize(RubyModule hpricotModule) { Object bufferSize; if (hpricotModule.TryGetClassVariable("@@buffer_size", out bufferSize)) { return (int)bufferSize; } return null; }
public static object RemoveClassVariable(RubyModule/*!*/ self, [DefaultProtocol]string/*!*/ variableName) { object value; if (!self.TryGetClassVariable(variableName, out value)) { RubyUtils.CheckClassVariableName(variableName); throw RubyExceptions.CreateNameError(String.Format("class variable {0} not defined for {1}", variableName, self.Name)); } self.RemoveClassVariable(variableName); return value; }
public static object RemoveClassVariable(RubyModule /*!*/ self, [DefaultProtocol] string /*!*/ variableName) { object value; if (!self.TryGetClassVariable(variableName, out value)) { RubyUtils.CheckClassVariableName(variableName); throw RubyExceptions.CreateNameError(String.Format("class variable `{0}' not defined for `{1}'", variableName, self.Name)); } self.RemoveClassVariable(variableName); return(value); }
public static object RemoveClassVariable(RubyModule /*!*/ self, [DefaultProtocol, NotNull] string /*!*/ variableName) { object value; if (!self.TryGetClassVariable(variableName, out value)) { self.Context.CheckClassVariableName(variableName); throw RubyExceptions.CreateNameError("class variable {0} not defined for {1}", variableName, self.Name); } self.RemoveClassVariable(variableName); return(value); }