class Rubocop::Cop::Style::Not
This cop checks for uses if the keyword not instead of !.
Constants
- MSG
Public Instance Methods
on_send(node)
click to toggle source
Calls superclass method
# File lib/rubocop/cop/style/not.rb, line 10 def on_send(node) _receiver, method_name, *args = *node # not does not take any arguments if args.empty? && method_name == :! && node.loc.selector.is?('not') add_offence(:convention, node.loc.selector, MSG) end super end