class RuboCop::Cop::Style::IfInsideElse
def autocorrect(corrector, node)
def autocorrect(corrector, node) if then?(node) # If the nested `if` is a then node, correct it first, # then the next pass will use `correct_to_elsif_from_if_inside_else_form` IfThenCorrector.new(node, indentation: 0).call(corrector) return end if node.modifier_form? correct_to_elsif_from_modifier_form(corrector, node) else correct_to_elsif_from_if_inside_else_form(corrector, node, node.condition) end end