HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/ruby/vendor_ruby/xpath/union.rb
# frozen_string_literal: true

module XPath
  class Union
    include Enumerable

    attr_reader :expressions
    alias_method :arguments, :expressions

    def initialize(*expressions)
      @expressions = expressions
    end

    def expression
      :union
    end

    def each(&block)
      arguments.each(&block)
    end

    def method_missing(*args) # rubocop:disable Style/MethodMissingSuper, Style/MissingRespondToMissing
      XPath::Union.new(*arguments.map { |e| e.send(*args) })
    end

    def to_xpath(type = nil)
      Renderer.render(self, type)
    end
    alias_method :to_s, :to_xpath
  end
end