class Synvert::Core::Rewriter::UnlessExistCondition

UnlessExistCondition checks if matching node doesn't exist in the node children.

Public Instance Methods

match?() click to toggle source

check if none of child node matches the rules.

# File lib/synvert/core/rewriter/condition/unless_exist_condition.rb, line 7
def match?
  match = false
  @instance.current_node.recursive_children do |child_node|
    match ||= child_node&.match?(@rules)
  end
  !match
end