From: Peter Ertl Date: 2006-03-03T00:37:13+09:00 Subject: Re: cleaner Ruby in a rails view theoretically nil is no container... practically this could help... class NilClass def each end end > --- Urspr�ngliche Nachricht --- > Von: Charlie Bowman > An: ruby-talk@ruby-lang.org (ruby-talk ML) > Betreff: Re: cleaner Ruby in a rails view > Datum: Fri, 3 Mar 2006 00:33:53 +0900 > > I know this is the ruby list and not the rails list but it would be nice > if we didn't have to add code to our views to rescue nils. I guess you > could add the method each if you to the nil class right? > > On Fri, 2006-03-03 at 00:29 +0900, dblack@wobblini.net wrote: > > > Hi -- > > > > On Fri, 3 Mar 2006, Charlie Bowman wrote: > > > > > As a side thought. Why doesn't the nil class have an each method that > > > returns nothing. It seems that this problem comes up quite often. > > > > Because it's not a container or iterator. > > > > > > David > > > Charlie Bowman > http://www.recentrambles.com >