Sha256: 72ae0e1b028e374412858b5d05b161c0e33cdded1ca917d5102959b0a0b643e6
Contents?: true
Size: 728 Bytes
Versions: 12
Compression:
Stored size: 728 Bytes
Contents
# frozen_string_literal: true module Synvert::Core::NodeQuery::Compiler # AttributeList contains one or more {Synvert::Core::NodeQuery::Compiler::Attribute}. class AttributeList # Initialize a AttributeList. # @param attribute [Synvert::Core::NodeQuery::Compiler::Attribute] the attribute # @param rest [Synvert::Core::NodeQuery::Compiler::AttributeList] the rest attribute list def initialize(attribute:, rest: nil) @attribute = attribute @rest = rest end # Check if the node matches the attribute list. # @return [Boolean] def match?(node) @attribute.match?(node) && (!@rest || @rest.match?(node)) end def to_s "[#{@attribute}]#{@rest}" end end end
Version data entries
12 entries across 12 versions & 1 rubygems