IronRuby.Builtins.RubyModule.TryGetConstant C# (CSharp) Method

TryGetConstant() private method

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
return 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

Ejemplo n.º 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