From: "David A. Black" Date: 2005-11-13T23:50:54+09:00 Subject: Re: Execute block in context of yielding method's module Hi -- On Sun, 13 Nov 2005, Christian Leskowsky wrote: > Hey guys, > > I'm very new to ruby. > > This is some freaky shite! Could somebody give me a use case as to when I'd > want to do something like this? Somewhat rarely :-) I actually prefer to know what 'self' is when I write a block. I'm uneasy with the idea that here: some_method { another_method } I can't tell by looking who's receiving the another_method message. A more common idiom is to provide the object so that you can see exactly who's doing what: class C attr_accessor :x def initialize yield self end end C.new do |c| c.x = 1 end and things like that. David -- David A. Black dblack@wobblini.net