Class: Synvert::Rewriter::UnlessExistCondition

Inherits:
Rewriter::Condition
  • Object
show all
Defined in:
lib/synvert/rewriter/conditions.rb

Instance Method Summary collapse

Instance Method Details

#matching_nodes(nodes) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/synvert/rewriter/conditions.rb', line 29

def matching_nodes(nodes)
  nodes.find_all { |node|
    match = false
    node.recursive_children do |child_node|
      match = match || (child_node && child_node.match?(@options))
    end
    !match
  }
end