From: Robert Klemme Date: 2010-04-03T03:05:11+09:00 Subject: Re: about define significance variable(in this situation) On 04/02/2010 10:01 AM, Zhenning Guan wrote: > def method_1(options ={}) > if some_conditions > options = {:method_2 => true} > method_2(options) > end > > method_3(options) > method_4(options) > end > > def method_2(options ={}) > # some code > end > > > method_1({:method_1 => true) > > +++++++++++++++++++++++ > > in some_condition, the variable options is most significant, but we use > temporary variable name options, it would rewrite options in method_1. > what would you do to name this variable? > > t_options? > temorary_options? I would not name it at all. def method_1(options ={}) if some_conditions method_2(:method_2 => true) end method_3(options) method_4(options) end Btw, I have a nagging feeling that what you are doing might not be such a good idea. But since we do not have any more context that's difficult to substantiate. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/