Method: RuboCop::Cop::HashAlignmentStyles::KeyAlignment#deltas

Defined in:
lib/rubocop/cop/mixin/hash_alignment_styles.rb

#deltas(first_pair, current_pair) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rubocop/cop/mixin/hash_alignment_styles.rb', line 20

def deltas(first_pair, current_pair)
  if Util.begins_its_line?(current_pair.source_range)
    key_delta = first_pair.key_delta(current_pair)
    separator_delta = separator_delta(current_pair)
    value_delta = value_delta(current_pair)

    { key: key_delta, separator: separator_delta, value: value_delta }
  else
    {}
  end
end