Module: RuboCop::Cop::AllowedIdentifiers
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/rubocop/cop/mixin/allowed_identifiers.rb |
Overview
This module encapsulates the ability to allow certain identifiers in a cop.
Constant Summary
-
SIGILS =
if a variable starts with a sigil it will be removed
'@$'
Instance Method Summary
Instance Method Details
#allowed_identifier?(name) ⇒ Boolean
# File 'lib/rubocop/cop/mixin/allowed_identifiers.rb', line 9
def allowed_identifier?(name) !allowed_identifiers.empty? && allowed_identifiers.include?(name.to_s.delete(SIGILS)) end
#allowed_identifiers
[ GitHub ]# File 'lib/rubocop/cop/mixin/allowed_identifiers.rb', line 13
def allowed_identifiers cop_config.fetch('AllowedIdentifiers') { [] } end