class RuboCop::Cop::Lint::UnderscorePrefixedVariableName
def check_variable(variable)
def check_variable(variable) return unless variable.should_be_unused? return if variable.references.empty? return if variable.references.none?(&:explicit?) node = variable.declaration_node location = if node.type == :match_with_lvasgn node.children.first.loc.expression else node.loc.name end add_offense(nil, location) end