class XPath::Union

Attributes

expressions[R]

Public Class Methods

new(*expressions) click to toggle source
# File lib/xpath/union.rb, line 7
def initialize(*expressions)
  @expressions = expressions
end

Public Instance Methods

each(&block) click to toggle source
# File lib/xpath/union.rb, line 11
def each(&block)
  expressions.each(&block)
end
method_missing(*args) click to toggle source
# File lib/xpath/union.rb, line 27
def method_missing(*args)
  XPath::Union.new(*expressions.map { |e| e.send(*args) })
end
to_s() click to toggle source
# File lib/xpath/union.rb, line 15
def to_s
  to_xpaths.join(' | ')
end
to_xpath(predicate=nil) click to toggle source
# File lib/xpath/union.rb, line 19
def to_xpath(predicate=nil)
  expressions.map { |e| e.to_xpath(predicate) }.join(' | ')
end
to_xpaths() click to toggle source
# File lib/xpath/union.rb, line 23
def to_xpaths
  [to_xpath(:exact), to_xpath(:fuzzy)].uniq
end