Module: Reek::Smells::NilCheck::NilWhenNodeDetector

Defined in:
lib/reek/smells/nil_check.rb

Overview

Detect 'when' statements that perform a nil check.

Class Method Summary collapse

Class Method Details

.detect(node) ⇒ Object


75
76
77
# File 'lib/reek/smells/nil_check.rb', line 75

def detect(node)
  node.condition_list.any? { |it| it.type == :nil }
end