class RuboCop::Cop::Style::OpMethod
parameter named ‘other`.
This cop makes sure that certain operator methods have their sole
def on_def(node)
def on_def(node) name, args, _body = *node return unless op_method?(name) && args.children.size == 1 && !TARGET_ARGS.include?(args) add_offense(args.children[0], :expression, format(MSG, name)) end
def op_method?(name)
def op_method?(name) return false if BLACKLISTED.include?(name) name !~ /\A\w/ || OP_LIKE_METHODS.include?(name) end