class RuboCop::Cop::VariableForce
def process_variable_assignment(node)
def process_variable_assignment(node) name = node.children.first unless variable_table.variable_exist?(name) variable_table.declare_variable(name, node) end # Need to scan rhs before assignment so that we can mark previous # assignments as referenced if rhs has referencing to the variable # itself like: # # foo = 1 # foo = foo + 1 process_children(node) variable_table.assign_to_variable(name, node) skip_children! end