Class: Synvert::Rewriter::IfExistCondition
- Defined in:
- lib/synvert/rewriter/condition.rb
Overview
IfExistCondition checks if matching node exists in the node children.
Instance Method Summary collapse
-
#match? ⇒ Boolean
check if any 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 any child node matches the rules.
27 28 29 30 31 32 33 |
# File 'lib/synvert/rewriter/condition.rb', line 27 def match? match = false @instance.current_node.recursive_children do |child_node| match = match || (child_node && child_node.match?(@instance, @rules)) end match end |