From: "Ivan V." Date: 2008-04-26T06:48:58+09:00 Subject: Re: How to return more than one object to a block Mikael Høilund wrote: > On Apr 25, 2008, at 22:54, Mikael H�ilund wrote: > >>> 'this' >> } >> >> should do it. >> > > Sorry, I seem to have mis-read your initial question. In order to do > what you asked, you would have to make them an array, though (unless > some of the plans for Ruby 1.9 are realized, which I sincerely hope > they are not). Maybe if you give a use-case, I could be a little more > helpful, though. Hi, My use case is like I stated on the start of my message. I created a function that takes a block, transforms the output of what's inside the block, and outputs the result. I came up with something like this: def form_label(label) block = yield([]) block = block.join("\n") if block.is_a?(Array) "#{label}: #{block}" end form_label 'example' do |a| a << text_field_tag ... a << link_to ... a << 'something more' end I didn't want to do something special inside the block (more than just calling functions, or returning strings), as I thought "yield" would capture everything that's inside it... which doesn't make sense once I think more about it :) - Ivan -- Posted via http://www.ruby-forum.com/.