Method: RuboCop::Cop::Style::MultilineInPatternThen#on_in_pattern

Defined in:
lib/rubocop/cop/style/multiline_in_pattern_then.rb

#on_in_pattern(node) ⇒ Object



39
40
41
42
43
44
45
46
# File 'lib/rubocop/cop/style/multiline_in_pattern_then.rb', line 39

def on_in_pattern(node)
  return if !node.then? || require_then?(node)

  range = node.loc.begin
  add_offense(range) do |corrector|
    corrector.remove(range_with_surrounding_space(range, side: :left, newlines: false))
  end
end