module RuboCop::Cop::ForbiddenPattern
This module encapsulates the ability to forbid certain patterns in a cop.
Public Instance Methods
Source
# File lib/rubocop/cop/mixin/forbidden_pattern.rb, line 7 def forbidden_pattern?(name) forbidden_patterns.any? { |pattern| Regexp.new(pattern).match?(name) } end
Source
# File lib/rubocop/cop/mixin/forbidden_pattern.rb, line 11 def forbidden_patterns cop_config.fetch('ForbiddenPatterns', []) end