class RuboCop::Cop::Style::AlignHash::SeparatorAlignment

Handles calculation of deltas when the enforced style is ‘separator’.

def deltas_for_first_pair(*)

def deltas_for_first_pair(*)
  {} # The first pair is always considered correct.
end

def hash_rocket_delta(first_pair, current_separator)

def hash_rocket_delta(first_pair, current_separator)
  first_pair.loc.operator.column - current_separator.column
end

def key_delta(first_pair, current_pair)

def key_delta(first_pair, current_pair)
  key_end_column(first_pair) - key_end_column(current_pair)
end

def key_end_column(pair)

def key_end_column(pair)
  key, _value = *pair
  key.loc.column + key.source.length
end

def value_delta(first_pair, current_pair)

def value_delta(first_pair, current_pair)
  _, first_value = *first_pair
  _, current_value = *current_pair
  first_value.loc.column - current_value.loc.column
end