Sha256: bd84f50084489690f4e959196c7040c9d156a85647d7e7751db59085a8c1198f
Contents?: true
Size: 445 Bytes
Versions: 10
Compression:
Stored size: 445 Bytes
Contents
# frozen_string_literal: true module Synvert::Core # IfOnlyExistCondition checks if node has only one child node and the child node matches rules. class Rewriter::IfOnlyExistCondition < Rewriter::Condition private # check if only have one child node and the child node matches rules. # # @return [Boolean] def match? target_node.body.size == 1 && @node_query.match_node?(target_node.body.first) end end end
Version data entries
10 entries across 10 versions & 1 rubygems