fixes/def.rb
# Does this method have var_name as a local variable?
# I.e. it is assigned?
# If search_parent_defs is true it also looks for parent defs.
Does this method have var_name as a local variable.
Does this method have var_name as a local variable .
def local_variable?(var_name, search_parent_defs:false)
    if var_name == '_result'
      return false
    end
    if real_local_variable? children, var_name
      return true
    end
    if search_parent_defs
      parent = self
      while parent = parent.parent
        if parent.is_a? DefNode
          if parent.real_local_variable? parent.children, var_name
            return true
          end
        end
      end
    end
    return false
  end
def local_variable? ( var_name , search_parent_defs : false ) if var_name == '_result' return false end if real_local_variable? children , var_name return true end if search_parent_defs parent = self while parent = parent . parent if parent . is_a? DefNode if parent . real_local_variable? parent . children , var_name return true end end end end return false end
Does this method have var_name as a local variable?
Does this method have var_name as a local variable?
# _result is never standard local variable # Parents
var_name
<not_specific>
search_parent_defs
<not_specific>