Esempio n. 1
0
 public static void SetAutoloadedConstant(RubyScope/*!*/ scope, object self,
     [DefaultProtocol, NotNull]string/*!*/ constantName, [DefaultProtocol, NotNull]MutableString/*!*/ path) {
     ModuleOps.SetAutoloadedConstant(scope.GetInnerMostModule(), constantName, path);
 }
Esempio n. 2
0
 public static MutableString GetAutoloadedConstantPath(RubyScope/*!*/ scope, object self, [DefaultProtocol, NotNull]string/*!*/ constantName) {
     return ModuleOps.GetAutoloadedConstantPath(scope.GetInnerMostModule(), constantName);
 }
Esempio n. 3
0
 public static RubyModule/*!*/ DefineNestedClass(RubyScope/*!*/ scope, string/*!*/ name, object superClassObject) {
     return RubyUtils.DefineClass(scope.GlobalScope, scope.GetInnerMostModule(), name, superClassObject);
 }
Esempio n. 4
0
 [Emitted] // ConstantVariable:
 public static object SetUnqualifiedConstant(object value, RubyScope/*!*/ scope, string/*!*/ name) {
     RubyUtils.SetConstant(scope.GetInnerMostModule(), name, value);
     return value;
 }
Esempio n. 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);
        }
Esempio n. 6
0
 public static RubyModule/*!*/ DefineNestedModule(RubyScope/*!*/ scope, string/*!*/ name) {
     return RubyUtils.DefineModule(scope.GlobalScope, scope.GetInnerMostModule(), name);
 }
Esempio n. 7
0
 public static object SetClassVariable(object value, RubyScope/*!*/ scope, string/*!*/ name) {
     return SetClassVariableInternal(scope.GetInnerMostModule(true), name, value);
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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);
 }
Esempio n. 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);
        }