class RuboCop::Cop::Style::HashSyntax

def check(pairs, delim, msg)

def check(pairs, delim, msg)
  pairs.each do |pair|
    if pair.delimiter == delim
      location = pair.source_range.begin.join(pair.loc.operator)
      add_offense(pair, location: location, message: msg) do
        opposite_style_detected
      end
    else
      correct_style_detected
    end
  end
end