Method: RuboCop::Cop::Style::SelfAssignment#autocorrect

Defined in:
lib/rubocop/cop/style/self_assignment.rb

#autocorrect(node) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'lib/rubocop/cop/style/self_assignment.rb', line 35

def autocorrect(node)
  _var_name, rhs = *node

  if rhs.send_type?
    autocorrect_send_node(node, rhs)
  elsif %i[and or].include?(rhs.type)
    autocorrect_boolean_node(node, rhs)
  end
end