IronRuby.Builtins.RubyModule.TryGetConstant C# (CSharp) Метод

TryGetConstant() приватный Метод

Get constant defined in this module.
private TryGetConstant ( RubyGlobalScope autoloadScope, string name, IronRuby.Runtime.ConstantStorage &value ) : bool
autoloadScope IronRuby.Runtime.RubyGlobalScope
name string
value IronRuby.Runtime.ConstantStorage
Результат bool
        internal bool TryGetConstant(RubyGlobalScope autoloadScope, string/*!*/ name, out ConstantStorage value) {
            using (Context.ClassHierarchyLocker()) {
                return TryGetConstantNoLock(autoloadScope, name, out value);
            }
        }

Same methods

RubyModule::TryGetConstant ( RubyGlobalScope autoloadScope, string name, object &value ) : bool

Usage Example

Пример #1
0
        public static bool IsConstantDefined(RubyModule /*!*/ self, [DefaultProtocol, NotNull] string /*!*/ constantName)
        {
            RubyUtils.CheckConstantName(constantName);
            object constant;

            // MRI checks declared constans only and don't trigger autoload:
            return(self.TryGetConstant(null, constantName, out constant));
        }
All Usage Examples Of IronRuby.Builtins.RubyModule::TryGetConstant
RubyModule