class RuboCop::Cop::Style::StringLiterals

Checks if uses of quotes match the configured preference.

def message(*)

def message(*)
  if style == :single_quotes
    "Prefer single-quoted strings when you don't need string " \
    'interpolation or special symbols.'
  else
    'Prefer double-quoted strings unless you need single quotes to ' \
    'avoid extra backslashes for escaping.'
  end
end

def offense?(node)

def offense?(node)
  # If it's a string within an interpolation, then it's not an offense
  # for this cop.
  return false if inside_interpolation?(node)
  wrong_quotes?(node, style)
end