class RuboCop::DirectiveComment
cops it contains.
special ‘rubocop:disable` and `rubocop:enable` comment and exposes what
This class wraps the `Parser::Source::Comment` object that represents a
def cops
def cops match = comment.text.match(CommentConfig::COMMENT_DIRECTIVE_REGEXP) return unless match cops_string = match.captures[1] cops_string.split(/,\s*/).uniq.sort end
def initialize(comment)
def initialize(comment) @comment = comment end
def match?(cop_names)
def match?(cop_names) cops == cop_names.uniq.sort end
def range
def range comment.location.expression end