class RuboCop::Cop::Layout::IndentHash

def check_right_brace(right_brace, left_brace, left_parenthesis)

def check_right_brace(right_brace, left_brace, left_parenthesis)
  # if the right brace is on the same line as the last value, accept
  return if right_brace.source_line[0...right_brace.column] =~ /\S/
  expected_column = base_column(left_brace, left_parenthesis)
  @column_delta = expected_column - right_brace.column
  return if @column_delta.zero?
  msg = if style == :align_braces
          'Indent the right brace the same as the left brace.'
        elsif style == :special_inside_parentheses && left_parenthesis
          'Indent the right brace the same as the first position ' \
          'after the preceding left parenthesis.'
        else
          'Indent the right brace the same as the start of the line ' \
          'where the left brace is.'
        end
  add_offense(right_brace, right_brace, msg)
end