本文整理汇总了C#中IronRuby.Runtime.RubyScope.GetInnerMostModuleForConstantLookup方法的典型用法代码示例。如果您正苦于以下问题:C# RubyScope.GetInnerMostModuleForConstantLookup方法的具体用法?C# RubyScope.GetInnerMostModuleForConstantLookup怎么用?C# RubyScope.GetInnerMostModuleForConstantLookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IronRuby.Runtime.RubyScope
的用法示例。
在下文中一共展示了RubyScope.GetInnerMostModuleForConstantLookup方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAnonymousClass
// implements Class#new
public static object CreateAnonymousClass(RubyScope/*!*/ scope, BlockParam body, RubyClass/*!*/ self, [DefaultParameterValue(null)]RubyClass superClass) {
RubyContext context = scope.RubyContext;
RubyModule owner = scope.GetInnerMostModuleForConstantLookup();
// MRI is inconsistent here, it triggers "inherited" event after the body of the method is evaluated.
// In all other cases the order is event first, body next.
RubyClass newClass = context.DefineClass(owner, null, superClass ?? context.ObjectClass, null);
return (body != null) ? RubyUtils.EvaluateInModule(newClass, body, new[] { newClass }, newClass) : newClass;
}
示例2: GetAutoloadedConstantPath
public static MutableString GetAutoloadedConstantPath(RubyScope/*!*/ scope, object self, [DefaultProtocol, NotNull]string/*!*/ constantName) {
return ModuleOps.GetAutoloadedConstantPath(scope.GetInnerMostModuleForConstantLookup(), constantName);
}
示例3: SetAutoloadedConstant
public static void SetAutoloadedConstant(RubyScope/*!*/ scope, object self,
[DefaultProtocol, NotNull]string/*!*/ constantName, [DefaultProtocol, NotNull]MutableString/*!*/ path) {
ModuleOps.SetAutoloadedConstant(scope.GetInnerMostModuleForConstantLookup(), constantName, path);
}
示例4: SetUnqualifiedConstant
[Emitted] // ConstantVariable:
public static object SetUnqualifiedConstant(object value, RubyScope/*!*/ scope, string/*!*/ name) {
RubyUtils.SetConstant(scope.GetInnerMostModuleForConstantLookup(), name, value);
return value;
}
示例5: DefineNestedClass
public static RubyModule/*!*/ DefineNestedClass(RubyScope/*!*/ scope, string/*!*/ name, object superClassObject) {
return RubyUtils.DefineClass(scope.GlobalScope, scope.GetInnerMostModuleForConstantLookup(), name, superClassObject);
}
示例6: DefineNestedModule
public static RubyModule/*!*/ DefineNestedModule(RubyScope/*!*/ scope, string/*!*/ name) {
return RubyUtils.DefineModule(scope.GlobalScope, scope.GetInnerMostModuleForConstantLookup(), name);
}