Class: RuboCop::Cop::HashAlignmentStyles::SeparatorAlignment
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
self,
ValueAlignment
|
|
Inherits: | Object |
Defined in: | lib/rubocop/cop/mixin/hash_alignment_styles.rb |
Overview
Handles calculation of deltas when the enforced style is 'separator'.
Instance Method Summary
- #deltas_for_first_pair(*_nodes)
- #hash_rocket_delta(first_pair, current_pair) private
- #key_delta(first_pair, current_pair) private
- #value_delta(first_pair, current_pair) private
ValueAlignment
- Included
Instance Method Details
#deltas_for_first_pair(*_nodes)
[ GitHub ]# File 'lib/rubocop/cop/mixin/hash_alignment_styles.rb', line 123
def deltas_for_first_pair(*_nodes) {} end
#hash_rocket_delta(first_pair, current_pair) (private)
[ GitHub ]# File 'lib/rubocop/cop/mixin/hash_alignment_styles.rb', line 133
def hash_rocket_delta(first_pair, current_pair) first_pair.delimiter_delta(current_pair) end
#key_delta(first_pair, current_pair) (private)
[ GitHub ]# File 'lib/rubocop/cop/mixin/hash_alignment_styles.rb', line 129
def key_delta(first_pair, current_pair) first_pair.key_delta(current_pair, :right) end
#value_delta(first_pair, current_pair) (private)
[ GitHub ]# File 'lib/rubocop/cop/mixin/hash_alignment_styles.rb', line 137
def value_delta(first_pair, current_pair) current_pair.value_omission? ? 0 : first_pair.value_delta(current_pair) end