class RuboCop::Cop::Style::AlignHash::KeyAlignment

Handles calculation of deltas (deviations from correct alignment) when the enforced style is 'key'.

Public Instance Methods

checkable_layout(_node) click to toggle source
# File lib/rubocop/cop/style/align_hash.rb, line 12
def checkable_layout(_node)
  true
end
deltas(first_pair, current_pair) click to toggle source
# File lib/rubocop/cop/style/align_hash.rb, line 20
def deltas(first_pair, current_pair)
  if Util.begins_its_line?(current_pair.source_range)
    { key: first_pair.loc.column - current_pair.loc.column }
  else
    {}
  end
end
deltas_for_first_pair(*) click to toggle source
# File lib/rubocop/cop/style/align_hash.rb, line 16
def deltas_for_first_pair(*)
  {} # The first pair is always considered correct.
end