From: Jacob Dunphy Date: 2007-08-26T07:07:41+09:00 Subject: Re: How can I make this if/else more succinct? It may not be more succinct, but it reads better to me. class Video def ext if self._3gp ==1 ".3gp" elsif self._3g2==1 ".3g2" elsif self.mp4==1 ".mp4" end end end expected = Video.find(:all).collect do |video| "#{self.id}_#{video.id}#{video.ext}" end On 8/24/07, eggie5 wrote: > How can I make this if/else more succinct? > > Video.find(:all).each do |video| > if video._3gp > ext=".3gp" > elsif video._3g2 > ext=".3g2" > elsif video.mp4 > ext=".mp4" > end > > > -- Jacob Dunphy http://dunphydesigns.com 626.318.2566