There are a lot of places in rubocop in which we check if a node is one of multiple node types. This allows those checks to be refactored to be less complex.
node.call_type? || node.const_type? || node.lvar_type?
# can become
node.type?(:call, :const, :lvar)
This covers both the standard node type predicates, as well as the meta predicates for multiple node types (ie. call_type? for send and csend).
If Node#string_type? in #328 is accepted, I'll add that in here as well.
There are a lot of places in rubocop in which we check if a node is one of multiple node types. This allows those checks to be refactored to be less complex.
This covers both the standard node type predicates, as well as the meta predicates for multiple node types (ie.
call_type?
forsend
andcsend
).If
Node#string_type?
in #328 is accepted, I'll add that in here as well.