Fix Ruby warning: shadowing outer local variable - value