class RuboCop::Cop::Style::QuotedSymbols

def invalid_double_quotes?(source)

def invalid_double_quotes?(source)
  return false unless style == :double_quotes
  # The string needs single quotes if:
  # 1. It contains a double quote
  # 2. It contains text that would become an escape sequence with double quotes
  # 3. It contains text that would become an interpolation with double quotes
  !/" | (?<!\\)\\[aAbcdefkMnprsStuUxzZ0-7] | \#[@{$]/x.match?(source)
end