lib/rubocop/cop/layout/end_alignment.rb in rubocop-0.89.1 vs lib/rubocop/cop/layout/end_alignment.rb in rubocop-0.90.0
- old
+ new
@@ -65,14 +65,15 @@
# end)
#
# variable =
# if true
# end
- class EndAlignment < Cop
+ class EndAlignment < Base
include CheckAssignment
include EndKeywordAlignment
include RangeHelp
+ extend AutoCorrector
def on_class(node)
check_other_alignment(node)
end
@@ -98,16 +99,14 @@
else
check_other_alignment(node)
end
end
- def autocorrect(node)
- AlignmentCorrector.align_end(processed_source,
- node,
- alignment_node(node))
- end
-
private
+
+ def autocorrect(corrector, node)
+ AlignmentCorrector.align_end(corrector, processed_source, node, alignment_node(node))
+ end
def check_assignment(node, rhs)
# If there are method calls chained to the right hand side of the
# assignment, we let rhs be the receiver of those method calls before
# we check if it's an if/unless/while/until.