From: Thomas Hurst Date: 2002-02-17T03:48:34+09:00 Subject: Re: passing blocks * David Corbin (dcorbin@imperitek.com) wrote: > 1) Is it possible to make the block optional? If so, how does one > determine that no block is present? Or, is it done by providing a > default block? If so, how? def bla if block_given? yield else puts "No block given" end end bla # <- No block given bla do puts "Block given" end # <- Block given -- Thomas 'Freaky' Hurst - freaky@aagh.net - http://www.aagh.net/ - The danger is not that a particular class is unfit to govern. Every class is unfit to govern. -- Lord Acton