Handles calculation of deltas when the enforced style is 'table'.
The table style is the only one where the first key-value pair can be considered to have bad alignment.
# File lib/rubocop/cop/style/align_hash.rb, line 78 def deltas_for_first_pair(first_pair, node) key_widths = node.children.map do |pair| key, _value = *pair key.loc.expression.source.length end @max_key_width = key_widths.max separator_delta = separator_delta(first_pair, first_pair.loc.operator, 0) { separator: separator_delta, value: value_delta(first_pair, first_pair) - separator_delta } end
Generated with the Darkfish Rdoc Generator 2.