Z
Zhenning Guan
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?
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?