# File lib/xpath/expression.rb, line 42 def to_xpath(predicate=nil) if @expressions.length == 1 "#{@left.to_xpath(predicate)}/#{@expressions.first.to_xpath(predicate)}" elsif @expressions.length > 1 "#{@left.to_xpath(predicate)}/*[#{@expressions.map { |e| "self::#{e.to_xpath(predicate)}" }.join(" | ")}]" else "#{@left.to_xpath(predicate)}/*" end end
Generated with the Darkfish Rdoc Generator 2.