Sha256: bf310e98b478217b8784b2b15c108038f5b8f1ff5d4bc5fec82907b3746831b9
Contents?: true
Size: 457 Bytes
Versions: 14
Compression:
Stored size: 457 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? @instance.current_node.body.size == 1 && @instance.current_node.body.first.match?(@rules) end end end
Version data entries
14 entries across 14 versions & 1 rubygems