From: "Jan E." Date: 2012-06-28T05:57:15+09:00 Subject: Re: Is this good code masta Blasta wrote in post #1066409: > Digging through more code i found an even more convoluted example. Here > there is a double end conditional. One of them is for a block. How can > you conditionally end a block?? You can't, the condition refers to the whole method call. As an example: #------------ condition = true [1, 2].each do |i| puts i end if condition #------------ If the condition is met, then the elements of the array will be printed. This is the same as wrapping the method call (with the block) into an if statement: #------------ condition = true if condition [1, 2].each do |i| puts i end end #------------ Since the first variant is obviously hard to read and can be misunderstood, you should definitely rewrite the code to the second variant. It may be a bit longer and less "cool", but you can understand it without playing parser first. > Sry for long line width Yeah, it would have been better if you'd attached the file. -- Posted via http://www.ruby-forum.com/.