本文整理汇总了C#中IronRuby.Runtime.BlockParam.BlockJumped方法的典型用法代码示例。如果您正苦于以下问题:C# BlockParam.BlockJumped方法的具体用法?C# BlockParam.BlockJumped怎么用?C# BlockParam.BlockJumped使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IronRuby.Runtime.BlockParam
的用法示例。
在下文中一共展示了BlockParam.BlockJumped方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EvaluateInModule
public static object EvaluateInModule(RubyModule/*!*/ self, BlockParam/*!*/ block, object defaultReturnValue) {
Assert.NotNull(self, block);
object returnValue = EvaluateInModuleNoJumpCheck(self, block);
if (block.BlockJumped(returnValue)) {
return returnValue;
}
return defaultReturnValue;
}
示例2: EvaluateInSingleton
public static object EvaluateInSingleton(object self, BlockParam/*!*/ block) {
// TODO: this is checked in method definition, if no method is defined it is ok.
// => singleton is create in method definition also.
if (!RubyUtils.CanCreateSingleton(self)) {
throw RubyExceptions.CreateTypeError("can't define singleton method for literals");
}
block.ModuleDeclaration = block.RubyContext.CreateSingletonClass(self);
// TODO: flows Public visibility in the block
// Flow "Singleton" method attribute? If we change method attribute
object returnValue = RubyOps.Yield1(self, self, block);
block.BlockJumped(returnValue);
return returnValue;
}