Example #1
0
 public static void SetAutoloadedConstant(RubyScope/*!*/ scope, object self,
     [DefaultProtocol, NotNull]string/*!*/ constantName, [DefaultProtocol, NotNull]MutableString/*!*/ path) {
     ModuleOps.SetAutoloadedConstant(scope.GetInnerMostModule(), constantName, path);
 }
Example #2
0
 public static MutableString GetAutoloadedConstantPath(RubyScope/*!*/ scope, object self, [DefaultProtocol, NotNull]string/*!*/ constantName) {
     return ModuleOps.GetAutoloadedConstantPath(scope.GetInnerMostModule(), constantName);
 }
Example #3
0
 public static RubyModule/*!*/ DefineNestedClass(RubyScope/*!*/ scope, string/*!*/ name, object superClassObject) {
     return RubyUtils.DefineClass(scope.GlobalScope, scope.GetInnerMostModule(), name, superClassObject);
 }
Example #4
0
 [Emitted] // ConstantVariable:
 public static object SetUnqualifiedConstant(object value, RubyScope/*!*/ scope, string/*!*/ name) {
     RubyUtils.SetConstant(scope.GetInnerMostModule(), name, value);
     return value;
 }
Example #5
0
        [Emitted] // UndefineMethod:
        public static void UndefineMethod(RubyScope/*!*/ scope, string/*!*/ name) {
            RubyModule owner = scope.GetInnerMostModule();

            if (!owner.ResolveMethod(name, RubyClass.IgnoreVisibility).Found) {
                throw RubyExceptions.CreateUndefinedMethodError(owner, name);
            }
            owner.UndefineMethod(name);
        }
Example #6
0
 public static RubyModule/*!*/ DefineNestedModule(RubyScope/*!*/ scope, string/*!*/ name) {
     return RubyUtils.DefineModule(scope.GlobalScope, scope.GetInnerMostModule(), name);
 }
Example #7
0
 public static object SetClassVariable(object value, RubyScope/*!*/ scope, string/*!*/ name) {
     return SetClassVariableInternal(scope.GetInnerMostModule(true), name, value);
 }
Example #8
0
 public static bool IsDefinedClassVariable(RubyScope/*!*/ scope, string/*!*/ name) {
     // owner is the first module in scope:
     RubyModule owner = scope.GetInnerMostModule(true);
     object value;
     return owner.TryResolveClassVariable(name, out value) != null;
 }
Example #9
0
 public static object TryGetClassVariable(RubyScope/*!*/ scope, string/*!*/ name) {
     object value;
     // owner is the first module in scope:
     scope.GetInnerMostModule(true).TryResolveClassVariable(name, out value);
     return value;
 }
Example #10
0
 public static object GetClassVariable(RubyScope/*!*/ scope, string/*!*/ name) {
     // owner is the first module in scope:
     RubyModule owner = scope.GetInnerMostModule(true);
     return GetClassVariableInternal(owner, name);
 }
Example #11
0
        [Emitted] // UndefineMethod:
        public static void UndefineMethod(RubyScope/*!*/ scope, string/*!*/ name) {
            RubyModule owner = scope.GetInnerMostModule();
            if (owner.ResolveMethod(name, true) == null) {
                throw RubyExceptions.CreateUndefinedMethodError(owner, name);
            }

            owner.UndefineMethod(name);
        }