class RuboCop::Cop::HashAlignment::KeyAlignment

Handles calculation of deltas when the enforced style is 'key'.

Public Instance Methods

checkable_layout?(_node) click to toggle source
# File lib/rubocop/cop/mixin/hash_alignment.rb, line 8
def checkable_layout?(_node)
  true
end
deltas(first_pair, current_pair) click to toggle source
# File lib/rubocop/cop/mixin/hash_alignment.rb, line 16
def deltas(first_pair, current_pair)
  if Util.begins_its_line?(current_pair.source_range)
    { key: first_pair.key_delta(current_pair) }
  else
    {}
  end
end
deltas_for_first_pair(*) click to toggle source
# File lib/rubocop/cop/mixin/hash_alignment.rb, line 12
def deltas_for_first_pair(*)
  {}
end