Class: RuboCop::Cop::HashAlignmentStyles::TableAlignment

Inherits:
Object
  • Object
show all
Includes:
ValueAlignment
Defined in:
lib/rubocop/cop/mixin/hash_alignment_styles.rb

Overview

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

Instance Method Summary collapse

Methods included from ValueAlignment

#checkable_layout?, #deltas

Instance Method Details

#deltas_for_first_pair(first_pair) ⇒ Object



84
85
86
87
88
89
90
# File 'lib/rubocop/cop/mixin/hash_alignment_styles.rb', line 84

def deltas_for_first_pair(first_pair)
  separator_delta = separator_delta(first_pair, first_pair, 0)
  {
    separator: separator_delta,
    value: value_delta(first_pair, first_pair) - separator_delta
  }
end