lib/rubocop/cop/style/and_or.rb in rubocop-0.59.2 vs lib/rubocop/cop/style/and_or.rb in rubocop-0.60.0
- old
+ new
@@ -2,11 +2,11 @@
module RuboCop
module Cop
module Style
# This cop checks for uses of `and` and `or`, and suggests using `&&` and
- # `||` instead. It can be configured to check only in conditions, or in
+ # `||` instead. It can be configured to check only in conditions or in
# all contexts.
#
# @example EnforcedStyle: always (default)
# # bad
# foo.save and return
@@ -72,11 +72,11 @@
end
private
def on_conditionals(node)
- node.condition.each_node(*LOGICAL_OPERATOR_NODES) do |logical_node|
- process_logical_operator(logical_node)
+ node.condition.each_node(*AST::Node::OPERATOR_KEYWORDS) do |operator|
+ process_logical_operator(operator)
end
end
def process_logical_operator(node)
return if node.logical_operator?