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