123456789_123456789_123456789_123456789_123456789_

Class: RuboCop::Cop::HashAlignmentStyles::KeywordSplatAlignment

Relationships & Source Files
Inherits: Object
Defined in: lib/rubocop/cop/mixin/hash_alignment_styles.rb

Overview

Handles calculation of deltas for kwsplat nodes. This is a special case that just ensures the kwsplat is aligned with the rest of the hash since a kwsplat does not have a key, separator or value.

Instance Method Summary

Instance Method Details

#deltas(first_pair, current_pair)

[ GitHub ]

  
# File 'lib/rubocop/cop/mixin/hash_alignment_styles.rb', line 146

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