Method: RuboCop::Cop::Lint::UnreachableCode#on_begin

Defined in:
lib/rubocop/cop/lint/unreachable_code.rb

#on_begin(node) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/rubocop/cop/lint/unreachable_code.rb', line 16

def on_begin(node)
  expressions = *node

  expressions.each_cons(2) do |e1, e2|
    next unless NODE_TYPES.include?(e1.type) || flow_command?(e1)
    add_offense(e2, :expression)
  end
end