Class: Hashira::Smells::ParamCheck
- Inherits:
-
Object
- Object
- Hashira::Smells::ParamCheck
- Defined in:
- lib/hashira/smells/param_check.rb
Constant Summary collapse
- COMPARISONS =
%i[== != =~].freeze
Instance Method Summary collapse
-
#initialize(node, name) ⇒ ParamCheck
constructor
A new instance of ParamCheck.
- #legitimate? ⇒ Boolean
- #matches ⇒ Object
Constructor Details
#initialize(node, name) ⇒ ParamCheck
Returns a new instance of ParamCheck.
8 9 10 11 |
# File 'lib/hashira/smells/param_check.rb', line 8 def initialize(node, name) @node = node @name = name end |
Instance Method Details
#legitimate? ⇒ Boolean
18 19 20 |
# File 'lib/hashira/smells/param_check.rb', line 18 def legitimate? absolved? || working? || nested.any?(&:legitimate?) end |
#matches ⇒ Object
13 14 15 16 |
# File 'lib/hashira/smells/param_check.rb', line 13 def matches return [] if legitimate? nested.flat_map(&:matches) + tested end |