From: Brian Candler Date: 2008-11-26T21:04:27+09:00 Subject: Re: Begin else pattern question Here's another option for removing the duplication of b_action: def initialize(value) begin if value == 'blah' a_action return end rescue end b_action end This is not identical to your original code, which would call b_action twice if an exception occurred during the first invocation of b_action. If a_action is short you could fold the first four lines to return a_action if value == 'blah' Note that a bare 'rescue' is the same as 'rescue StandardError'. Certain exceptions, typically due to lack of system resources, are not caught. Often that is what you want, but to catch absolutely everything do rescue Exception Finally, there is the expression version of rescue, which I believe catches StandardError: def initialize(value) (return a_action if value == 'blah') rescue nil b_action end Regards, Brian. -- Posted via http://www.ruby-forum.com/.