Sha256: 43efb0a07b6fe788a915f410bed2200e9906b5d8291f6866e10c18cbb1410085
Contents?: true
Size: 558 Bytes
Versions: 12
Compression:
Stored size: 558 Bytes
Contents
module XPath class Union include Enumerable attr_reader :expressions def initialize(*expressions) @expressions = expressions end def each(&block) expressions.each(&block) end def to_s to_xpaths.join(' | ') end def to_xpath(predicate=nil) expressions.map { |e| e.to_xpath(predicate) }.join(' | ') end def to_xpaths [to_xpath(:exact), to_xpath(:fuzzy)].uniq end def method_missing(*args) XPath::Union.new(*expressions.map { |e| e.send(*args) }) end end end
Version data entries
12 entries across 12 versions & 3 rubygems