class RuboCop::Cop::Style::CharacterLiteral

?C-M-d
# good
’x’
# good
?x
# bad
@example
Checks for uses of the character literal ?x.

def autocorrect(corrector, node)

def autocorrect(corrector, node)
  string = node.source[1..-1]
  # special character like \n
  # or ' which needs to use "" or be escaped.
  if string.length == 2 || string == "'"
    corrector.replace(node, %("#{string}"))
  elsif string.length == 1 # normal character
    corrector.replace(node, "'#{string}'")
  end
end

def correct_style_detected; end

called from StringHelp.
Dummy implementation of method in ConfigurableEnforcedStyle that is
def correct_style_detected; end

def offense?(node)

def offense?(node)
  # we don't register an offense for things like ?\C-\M-d
  node.loc.begin.is?('?') &&
    node.source.size.between?(2, 3)
end

def opposite_style_detected; end

called from StringHelp.
Dummy implementation of method in ConfigurableEnforcedStyle that is
def opposite_style_detected; end