public ToLambda ( |
||
method | ||
return |
internal RubyLambdaMethodInfo(Proc/*!*/ block, string/*!*/ definitionName, RubyMemberFlags flags, RubyModule/*!*/ declaringModule) : base(flags, declaringModule) { Assert.NotNull(block, definitionName, declaringModule); _lambda = block.ToLambda(this); _definitionName = definitionName; _id = Interlocked.Increment(ref _Id); }
public static Proc /*!*/ DefineMethod(RubyScope /*!*/ scope, RubyModule /*!*/ self, [DefaultProtocol] string /*!*/ methodName, [NotNull] Proc /*!*/ method) { // MRI: ignores ModuleFunction scope flag (doesn't create singleton method). // MRI 1.8: uses private visibility if module_function is applied (bug). // MFI 1.9: uses public visibility as we do, unless the name is special. var visibility = RubyUtils.GetSpecialMethodVisibility(scope.Visibility, methodName); self.AddMethod(methodName, Proc.ToLambdaMethodInfo(method.ToLambda(), methodName, visibility, self)); return(method); }