Method: RuboCop::Cop::Naming::AsciiIdentifiers#on_new_investigation

Defined in:
lib/rubocop/cop/naming/ascii_identifiers.rb

#on_new_investigationObject

[View source]

59
60
61
62
63
64
65
66
# File 'lib/rubocop/cop/naming/ascii_identifiers.rb', line 59

def on_new_investigation
  processed_source.tokens.each do |token|
    next if !should_check?(token) || token.text.ascii_only?

    message = token.type == :tIDENTIFIER ? IDENTIFIER_MSG : CONSTANT_MSG
    add_offense(first_offense_range(token), message: message)
  end
end