Sha256: c090cc9173bb3f1380e8ee41192acc15a7746fd8c7b8fd02b0509affe97af7f4
Contents?: true
Size: 406 Bytes
Versions: 16
Compression:
Stored size: 406 Bytes
Contents
# encoding: utf-8 module Synvert::Core # IfExistCondition checks if node has only one child node and the child node matches rules. class Rewriter::IfOnlyExistCondition < Rewriter::Condition # check if only have one child node and the child node matches rules. def match? @instance.current_node.body.size == 1 && @instance.current_node.body.first.match?(@rules) end end end
Version data entries
16 entries across 16 versions & 1 rubygems