Class: Synvert::Rewriter::UnlessExistCondition
- Defined in:
- lib/synvert/rewriter/condition.rb
Overview
UnlessExistCondition checks if matching node doesn’t exist in the node children.
Instance Method Summary collapse
-
#match? ⇒ Boolean
check if none of child node matches the rules.
Methods inherited from Condition
Constructor Details
This class inherits a constructor from Synvert::Rewriter::Condition
Instance Method Details
#match? ⇒ Boolean
check if none of child node matches the rules.
39 40 41 42 43 44 45 |
# File 'lib/synvert/rewriter/condition.rb', line 39 def match? match = false @instance.current_node.recursive_children do |child_node| match = match || (child_node && child_node.match?(@instance, @rules)) end !match end |