Method: Synvert::Core::Rewriter::Instance#if_only_exist_node
- Defined in:
- lib/synvert/core/rewriter/instance.rb
#if_only_exist_node(rules, &block) ⇒ Object
Parse if_only_exist_node
dsl, it creates a Synvert::Core::Rewriter::IfOnlyExistCondition to check if current node has only one child node and the child node matches rules, if so, then continue operating on each matching ast node.
214 215 216 |
# File 'lib/synvert/core/rewriter/instance.rb', line 214 def if_only_exist_node(rules, &block) Rewriter::IfOnlyExistCondition.new(self, rules, &block).process end |