From: Mikel Lindsaar Date: 2008-11-26T10:02:41+09:00 Subject: Re: Begin else pattern question ------=_Part_14900_12016150.1227661642617 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, Nov 26, 2008 at 11:10 AM, Eric I. wrote: > On Nov 25, 6:19 pm, Mikel Lindsaar wrote: > > Any other simpler way to do this pattern? > One simplification would be to remove the "begin" and the > corresponding "end" since they're not needed in this situation. > Actually... that cleans it up enough and makes it nice and readable. def initialize(raw_field) if a a_action else b_action end rescue b_action end Why aren't the begin and end blocks needed? Is it because it is already encapsulated within a method any way and if it hits rescue, the rescue block is terminated by the method end in any case? What I am trying to ask is "where did you learn when the begin and end are needed and when not?" :) -- http://lindsaar.net/ Rails, RSpec and Life blog.... ------=_Part_14900_12016150.1227661642617--