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

TryGetConstant() public method

public TryGetConstant ( RubyGlobalScope autoloadScope, string name, object &value ) : bool
autoloadScope IronRuby.Runtime.RubyGlobalScope
name string
value object
return bool
        public bool TryGetConstant(RubyGlobalScope autoloadScope, string/*!*/ name, out object value) {
            ConstantStorage storage;
            var result = TryGetConstant(autoloadScope, name, out storage);
            value = storage.Value;
            return result;
        }

Same methods

RubyModule::TryGetConstant ( RubyGlobalScope autoloadScope, string name, IronRuby.Runtime.ConstantStorage &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