RuboCop::Cop
This cop enforces the use the shorthand for self-assignment.
@example
# bad x = x + 1 # good x += 1
# File lib/rubocop/cop/style/self_assignment.rb, line 28 def on_cvasgn(node) check(node, :cvar) end
# File lib/rubocop/cop/style/self_assignment.rb, line 24 def on_ivasgn(node) check(node, :ivar) end
# File lib/rubocop/cop/style/self_assignment.rb, line 20 def on_lvasgn(node) check(node, :lvar) end
[Validate]
Generated with the Darkfish Rdoc Generator 2.