class RuboCop::Cop::Style::AlignHash::AlignmentOfValues

values are aligned.
Common functionality for the styles where not only keys, but also

def all_have_same_sparator?(node)

def all_have_same_sparator?(node)
  first_separator = node.children.first.loc.operator.source
  node.children[1..-1].all? do |pair|
    pair.loc.operator.is?(first_separator)
  end
end

def any_pairs_on_the_same_line?(node)

def any_pairs_on_the_same_line?(node)
  lines_of_the_children = node.children.map do |pair|
    key, _value = *pair
    key.loc.line
  end
  lines_of_the_children.uniq.size < lines_of_the_children.size
end

def checkable_layout(node)

def checkable_layout(node)
  !any_pairs_on_the_same_line?(node) && all_have_same_sparator?(node)
end

def deltas(first_pair, _prev_pair, current_pair)

def deltas(first_pair, _prev_pair, current_pair)
  key_delta = key_delta(first_pair, current_pair)
  current_separator = current_pair.loc.operator
  separator_delta = separator_delta(first_pair, current_separator,
                                    key_delta)
  value_delta = value_delta(first_pair, current_pair) -
    key_delta - separator_delta
  { key: key_delta, separator: separator_delta, value: value_delta }
end

def separator_delta(first_pair, current_separator, key_delta)

def separator_delta(first_pair, current_separator, key_delta)
  if current_separator.is?(':')
    0 # Colon follows directly after key
  else
    hash_rocket_delta(first_pair, current_separator) - key_delta
  end
end