GetDummySingletonClass() private method

private GetDummySingletonClass ( ) : RubyClass
return RubyClass
Example #1
0
        // thread safe:
        internal void InitializeImmediateClass(RubyClass/*!*/ singletonSuperClass, Action<RubyModule> trait) {
            Assert.NotNull(singletonSuperClass);

            RubyClass immediate;
            if (IsClass) {
                // class: eager singleton class construction:
                immediate = CreateSingletonClass(singletonSuperClass, trait);
                immediate.InitializeImmediateClass(_context.ClassClass.GetDummySingletonClass());
            } else if (trait != null) {
                // module: eager singleton class construction:
                immediate = CreateSingletonClass(singletonSuperClass, trait);
                immediate.InitializeImmediateClass(singletonSuperClass.GetDummySingletonClass());
            } else {
                // module: lazy singleton class construction:
                immediate = singletonSuperClass;
            }

            InitializeImmediateClass(immediate);
        }