class RuboCop::MagicComment::EditorComment

def match(keyword)

Returns:
  • (nil) - otherwise
  • (String) - extracted value if it is found

Parameters:
  • keyword (String) --
def match(keyword)
  pattern = /\A#{keyword}\s*#{self.class::OPERATOR}\s*(#{TOKEN})\z/
  tokens.each do |token|
    next unless (value = token[pattern, 1])
    return value.downcase
  end
  nil
end